I created an FSM with Akka. However, my FSM doesn't only get messages passed that are relevant for its FSM state. Its children may also pass ActorRef
s up to it, which my FSM should then pass further up to its parent. Since FSMs in Akka are (naturally) also actors, I would like to override receive
to catch those ActorRefs
. However, doing that broke the FSM functionality of the actor. What's the proper way to handle a situation like this?
Is it safe to override `receive` in an Akka FSM?
196 views Asked by typeduke At
1
Messages that are not relevant for any FSM state can be handled in
whenUnhandled
:Though, overriding
receive
should, afaik, work, too.