rkrzewski / akka-cluster-etcd

Akka cluster management using etcd
Other
70 stars 14 forks source link

Improve `FlowBreaker` implementation #25

Closed rkrzewski closed 8 years ago

rkrzewski commented 9 years ago

Currently FlowBreaker uses Flow.takeWhile which will terminate the stream when (if) another input element becomes available. An alternative implementation is possible, using akka.stream.stage.AsyncStage that would trigger stream termination immediately after Cancellable.cancel() were called.

Stages are documented in http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0/scala/stream-customize.html Digging into akka.stream.impl.fusing.MapAsync implemention would probalby be a good start.