Is it possible at all in Akka Streams to cancel the futures produced in
mapAsync on stream failure? It seems to be desirable, because some computations are cancellable, and only this graph stage knows the current unresolved futures. Keeping track on the side is quite inconvenient.
Here’s the use case:
- executing many requests through Cassandra driver,
- with a common deadline.
Statement.executeAsync produces a
ResultSetFuture, which has method
cancel() — although it doesn’t cancel the request in Cassandra, it cancels its retry if it fails and it eagerly releases resources allocated in the driver to track this request.
I see that Alpakka Cassandra connector sidesteps this issue and never calls
cancel(). Is it possible at all with Akka Streams?