Pooled State Machines
State Machines
noreferences

@@description
<p>      
<a href="QueuedStateMachines.html">Queued</a> and <a href="BasicStateMachines.html">regular state machines</a> always process events in the order they arrive, and ignore events that cannot be handled in the current state. Sometimes, however, you want to 'save' events that arrive out of sequence, and process them as soon you enter a state that can handle them. This is accomplished by adding the word 'pooled' before a state machine definition. 
</p>

<p>      
In a pooled state machine there is a queue in a separate thread, just like in a queued state machine, however, if the next event to be processed has no handler in the current state, then it remains at the front of the queue, and the queue processor looks further back in the queue for the first event that can be handled.
</p>

<p>      
A pooled state machine will therefore often process events in a different order from a regular or queued state machine.
</p>

@@syntax

[[inlineStateMachine]]

@@example
@@source manualexamples/PooledStateMachines1.ump &diagramtype=state
@@endexample
