I’ve written some custom GraphStages and they work well, but they do not shut down in a timely manner when I use a killswitch or implement an asynchronous sidechannel with a promise. Here’s the code for the graph stages:
and the shape of my graph is
val graph = source3.viaMat(KillSwitches.single)(Keep.right).via(readerFlow).via(uploaderFlow).toMat(sink)(Keep.both)
When I run this graph, and initiate the kill switch, the stream seems to want to complete 8 elements from the source before halting execution and cleaning up. I need much more responsive shutdown times though. Any suggestions on what I’m doing wrong here? Am I relying on backpressure too much or something?