Closed carminoplata closed 2 months ago
I would be interested in the also. Currently I am thinking that I would run the whole state machine in a separate thread, and that I have to queue the incoming event myself?
The best approach depends on the demand. Since we don't have an internal loop that "run forever", one can implement that method that reads from a stream of events and send the events to the state machine, and this method can live in a dedicated thread.
Do you have a problem idea so I can work on an example?
We've improved the support for threading with a mutex that does multi-threading synchronization on 2.3.2 (not released yet), but basic threading (run on another thread) is possible even on older versions.
Please take a look at tests/test_threading.py for a few examples.
Hi there,
I looked at the code because I saw that when the first event is sent, the thread which is the owner of the state machine is blocked until the whole chain of events is fully consumed. Is there any possibility to update it in order to make the statemachine fully managed by a separate thread?