Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Launch UI from State Actor

Solved!
Go to solution

The state actor template shipping with State Actor launches a UI actor, which launches a nested idle state actor.

 

What happens if I launch a UI in idle's actor core? Will this launch a UI everytime I switch state from running to idle?

 

I am asking because I find it sometimes more natural if the model launches its UI.

Actor Framework
0 Kudos
Message 1 of 3
(591 Views)
Solution
Accepted by topic author Quiztus2

You only ever launch one actor core, regardless of the number of states you have.  When I have used the state pattern actor, that actor core has belonged to the immediate child of State Actor (which I typically refer to as the "context").  That actor core runs exactly once, for the life of the state actor, so you could launch a nested actor from there.

 

In the example, Process State is the context actor.  It has an actor core, which actually does launch a nested actor - Process Actor.  Idle and Running do not have actor core overrides.  Launching either Idle or Running will start Process State:Actor Core, which will launch Process Actor.

Message 2 of 3
(566 Views)

@justACS wrote:

You only ever launch one actor core, regardless of the number of states you have.


This was not obvious to me, but it makes complete sense.

Actor Framework
0 Kudos
Message 3 of 3
(520 Views)