Closed dorado-lmz closed 8 years ago
Keeping the code completely synchronous was another deliberate design decision, as I do not want to impose any particular asynchronous strategy on my users - what's good for one is likely to be bad for another.
What I'd suggest for async operations is that you keep a reference/id to the async task in the state machine instance and either cancel the task or wait for it to complete explicitly. E.g. WindowTimers.setTimeout
returns a timeoutID
that can be subsequently passed into WindowTimers.clearTimeout
.
Re. orthogonal (parallel) regions, this is not a means for concurrency at runtime; this is used to have independent substates of a machine being able to react independently to the same message.
thanks for your reply of last pull request
And this time i deal with some other problems.
new state.State("stateB", model).entry(function (message, instance) { instance.calls += 2; });
,if i want to execute async code , and next state will use last state's result.