Comments (4)
Correct.
Both sync and async executors are single-threaded and run tasks consequentially (next task starts only when current is completed). Thus, for logic, implemented within state / event handlers there is no concurrency.
from easyflow.
If it thread-safe why you need to use queue in SyncExecutor?
from easyflow.
I wanted to isolate task execution.
Let's say we have handler for state State and in that handler we trigger event Event that moves FSM into state State2 that also has a handler.
If tasks are not separated, then execution flow will enter handler for State, then, when Event triggered execution flow will get into handler for State2, then it will return back to handler for State (if there is some code after trigger() call). To avoid it, I used queue.
With the queue, first, handler for State will be fully executed, and then, if event was triggered, handler for State2.
Also, SyncExecutor was ment mainly for unit tests, to avoid thread creation / waiting / termination but at the same time behave the same way as AsyncExecutor does.
from easyflow.
Ok, i was wrong.
from easyflow.
Related Issues (20)
- StateHandler for whenEnter never invokes HOT 6
- Race condition during flow starting. HOT 1
- JavaDoc HOT 1
- Handlers fired multiple times for same transition HOT 1
- Easyflow never terminates its threads HOT 4
- Duplicated depending - slf4j-api
- Support possibility to create flow in a step by step manner HOT 3
- What the right way to "clean up" after exception during state process? HOT 2
- Adding terminate() method? HOT 1
- Support for non-deterministic FSM HOT 1
- Current pattern/library status HOT 7
- Paper
- This is no longer working HOT 3
- In which package or library can I fine the "StatefulContext" class?
- The "on" method cannot be called HOT 1
- non-android example HOT 1
- Support of forks
- Some events are not triggered in a consistent manner
- StateHandler for whenEnter never invokes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easyflow.