Run machines in another thread #1255
Replies: 1 comment 1 reply
-
No. Or rather - impossible for guards unless you make all guarded transitions "multi-state". As you have noticed - everything would have to be communicated through events between your threads. So it's totally doable but would complicate your models quite significantly. I'm not sure what benefits of this would be. I wouldn't expect machines to be a bottleneck in your application 😉 If you feel adventurous you could experiment with that but I wouldn't personally recommend trying to think in terms of guards and actions, just sending events back and forth. Later you could try to build some abstraction that would hide this complexity in it, but I would try to implement bare-bones communication based on events first to check if it brings any benefits to your use case. |
Beta Was this translation helpful? Give feedback.
-
Is it possible to move all the guards and assign actions off the main-thread?
Has anyone tried running machines in web workers with a simple "send" interface?
Beta Was this translation helpful? Give feedback.
All reactions