Let typed Stateful optionally handle signals also, #22293
* and thereby no need for MessageOrSignal
This commit is contained in:
parent
b2b4f64d97
commit
f485be2bf5
8 changed files with 122 additions and 128 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue