+str #17290 Adds preStart / postStop to AbstractStage

+ AsyncStage now uses preStart
+ Log stage now uses preStart (better perf), can be optimised more
This commit is contained in:
Konrad Malawski 2015-05-11 00:09:59 +02:00
parent f24f43895d
commit 9607ec0cdf
10 changed files with 437 additions and 69 deletions

View file

@ -3,15 +3,10 @@
*/
package akka.stream.impl.fusing
import akka.stream.stage.{ TerminationDirective, SyncDirective, Context, PushStage }
import scala.util.control.NoStackTrace
import akka.stream.Supervision
class InterpreterSpec extends InterpreterSpecKit {
import Supervision.stoppingDecider
import Supervision.resumingDecider
import Supervision.restartingDecider
"Interpreter" must {
@ -462,13 +457,6 @@ class InterpreterSpec extends InterpreterSpecKit {
}
// This test is related to issue #17351
class PushFinishStage extends PushStage[Any, Any] {
override def onPush(elem: Any, ctx: Context[Any]): SyncDirective = ctx.pushAndFinish(elem)
override def onUpstreamFinish(ctx: Context[Any]): TerminationDirective =
ctx.fail(akka.stream.testkit.Utils.TE("Cannot happen"))
}
"work with pushAndFinish if upstream completes with pushAndFinish" in new TestSetup(Seq(
new PushFinishStage)) {