Re: [akka-user] Re: [2.5-Scala] How to cleanup Sink/Source?

2016-03-11 Thread Andrew Gaydenko
Or, if to reformulate, how does transparent stage look? -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> Search the archives: https://groups.google.com/group/akka-user --- Yo

Re: [akka-user] Re: [2.5-Scala] How to cleanup Sink/Source?

2016-03-11 Thread Andrew Gaydenko
Johan, hi! Sorry, haven't grokked exactly :) Do I understand correctly, in code above I must eliminate all complete()/cancel() calls, instead just bothering about own clean up only? In other words, are `finish` events propagating to other stages independently these my stage's in/out handlers?

Re: [akka-user] Re: [2.5-Scala] How to cleanup Sink/Source?

2016-03-11 Thread Akka Team
In general the sources and sinks should take care of cleaning up themselves rather than have some downstream/upstream element report cancel/failure/completion through a side channel, if you are implementing a custom Source it's OutHandler will get a onDownstreamFinish and if your are writing a Sink

[akka-user] Re: [2.5-Scala] How to cleanup Sink/Source?

2016-03-06 Thread Andrew Gaydenko
Or - must the last method be override def onDownstreamFinish(): Unit = { cancel(in) onDownFinish } ? -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >>

[akka-user] Re: [2.5-Scala] How to cleanup Sink/Source?

2016-03-06 Thread Andrew Gaydenko
At the moment I have got this approach. Let's define a stage: class OnFinish[A] extends GraphStage[FlowShape[A, A]] { def onUpFinish: Unit = {} def onDownFinish: Unit = {} val in = Inlet[A]("onFinish.in") val out = Outlet[A]("onFinish.out") override val shape = FlowShape.of(in, out)