SubscribeState¶
-
ISubscription IStateMachine.SubscribeState(System.Collections.IEnumerable<T> states, StateMachineStateHandler<T> handler)¶
Subscribes a callback to be executed when the state of the state machine changes to one of the specified states.
- Parameters
states – States for which the callback is triggered.
handler – Delegate to be invoked when the state machine state changes to one of the specified states.
- Returns
ISubscription – An ISubscription for the callback.
- Throws
NullArgumentException– Null reference was passed.InvalidArgumentException– One or more unknown states specified.InvalidArgumentException– Empty collection of states specified.OutOfResourcesException– No resources available to subscribe callback.CommunicationErrorException– Protocol error.ConnectionLostException– Connection to controller lost.RebootedException– Controller has been rebooted since this object reference was retrieved, invalidating this reference.
- Remarks
If the state already matches one of the specified states, a callback is generated immediately.