Event collector

Both the synchronous state machine and the asynchronous state machine implement the possibility to enqueue events to be processed form inside a state or a transition by using the push method.

The use of the event collector is demonstrated in an example.

Synchronous state machine

The synchronous state machine processes all events from the internal queue after processing of the current event is over. The events are processed in the order in which they were enqueued.

Asynchronous state machine

The asynchronous state machine adds "pushed" events in the main event queue. Form there the enqueued events are processed in the order of thier priority. Events with the same priority are processed in the order in that they were enqueued.