statemachine icon indicating copy to clipboard operation
statemachine copied to clipboard

PassiveStateMachine fails to execute events fired by different callers on their respective threads. Is this expected?

Open bhanugayam opened this issue 4 years ago • 1 comments

While one caller is executing an event if different fires event it is returned after adding it to queue. Meanwhile, the first caller tries to execute the newly added event in the queue before it returns.

This creates an issue with Stop behavior as while one caller is busy with executing events in the queue if other callers go on adding events to queue still the state machine will be running till all events have been executed.

This is different from the description given for PassiveStateMachine related to State Machine Events Execution.

bhanugayam avatar Mar 20 '20 03:03 bhanugayam

If you call the same state machine instance from multiple threads, you must use the ActiveStateMachine. The PassiveStateMachine cannot handle multiple threads.

The ActiveStateMachine executes the events on its own thread and returns the call to Fire after the event was queued.

ursenzler avatar Mar 21 '20 16:03 ursenzler