Closed maxpeng closed 5 years ago
Thank you for this feedback. I don't think I've used postFIFO() or postLIFO() yet in my own use of this framework, so I haven't run into this problem. I will want to make a regression test for this issue, so do I have permission to copy into this project some/all of the code from the attached example (I will attribute your github userid and apply the MIT license to it) ?
Sure, you have the permission to use the sample as you want.
By the way, the example just implements the first statechart depicted here - A simple on-off statechart - Statecharts.
Thanks!
First, I would like to thank you for creating this useful python package.
Problem
I implement a simple on-off switch using farc. After state machine is started, I post a flick event after 2 seconds. However, the flick event will not be executed by the state machine. Refer the attached file on-off-switch.zip about the example.
Log before change:
Change
Framework.run()
is implemented with run-to-completion execution model.Framework.run()
will exit if there is event in the queue. In order to makeFramework.run()
to be executed again, I need to callFramework._event_loop.call_soon_threadsafe(Framework.run)
when an event is posted.Log after change: