statemachine
statemachine copied to clipboard
Pausing
I've got a number of ActiveStateMachines that work in concert, but then something big happens at which point I need to stop them all (so I call Stop() on them all), but I don't want any events to be queued up while they're paused -- I will reenable them later after the big thing is over, and when I click Start() again I'd like them to continue right where they were. Suggestions? thanks
I think the easiest solution would be to add some code in front of these state machines in the form of a decorator for the Fire
method. As long as the state machines are running, it forwards the call to Fire
on the state machine. When you stop the state machines, the calls are not forwarded any more. On resume, the forwarding continues as well.
Another option would be to copy the class for the state machine from Appccelerate to sour code and change the code so that events are not queued while the state machine is stopped.