Closed AndrewBloom closed 9 months ago
Yes, fsm and submachine use different queues, which is unfortunate in this case. Actually I now think all should happen on the upper fsm, which might be an issue because the sub does not know its upper. The new back11 backend state machines now support a _getupper() so that it is now possible.
To me it seems that execute_enqueue_events should recursively call the same for all the submachines
example:
this prints out: SubSMFE constructor InitState Fake1State queue size main 0 sub 2
queue size main 0 sub 3
Fake2State Fake3State Fake4State
I would have expected that sm.execute_queued_events(); would execute the events. This is specially useful cause a submachine can enqueue events with fsm.enqueue_event(my_ev()) on an owned manager class (a networkPacketsManager for example with its own thread). Actually, they should have the option to share the same queue, it would make everything much simpler (think synchronisation for example - I managed to use my own queue, and it would be better you used a std::queue instead of std::deque, which has a smaller interface and doesn't have the double action front/pop_front which is problematic if you want to use a lock and a mutex).