Let typed Stateful optionally handle signals also, #22293

* and thereby no need for MessageOrSignal
This commit is contained in:
Patrik Nordwall 2017-03-16 14:44:03 +01:00
parent b2b4f64d97
commit f485be2bf5
8 changed files with 122 additions and 128 deletions

View file

@ -114,7 +114,8 @@ class IntroSpec extends TypedSpec {
//#chatroom-main
val main: Behavior[akka.NotUsed] =
SignalOrMessage(
Stateful(
behavior = (_, _) Unhandled,
signal = { (ctx, sig)
sig match {
case PreStart
@ -128,8 +129,7 @@ class IntroSpec extends TypedSpec {
case _
Unhandled
}
},
mesg = (_, _) Unhandled)
})
val system = ActorSystem("ChatRoomDemo", main)
Await.result(system.whenTerminated, 1.second)