Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conditional-transition: conditioner will not be completed, introduced fsm hung. #133

Open
seaskydl opened this issue Dec 26, 2022 · 1 comment

Comments

@seaskydl
Copy link

1.To create more than 1 fsm with the same config,
const cfg = {
...
events: {
...
{
name: 'step',
from: 'init',
to: ['a', 'b', 'c'],
condition: function (options) {
const {args:[{instanceid, id}]} = options;
console.log(instanceid(${instanceid}) ID:{id:${id}- method condition was called);
return new Promise(function (resolve, reject) {
resolve(id%3);
});
},
},
...
}
...
}

fsm_(1...n) = StateMachine({...cfg});

  1. using those fsm in different concurrent workers, pass the args to the machine
    fsm_(n) .step({instanceid: fsm_(n).instanceId(), id: a_random_num});

concurrent process data by different fsm created above, the condition method will not be called properly and the state machine was broken.

@vstirbu
Copy link
Owner

vstirbu commented Jan 9, 2023

Hi! Can you create a minimal example that demonstrates the issue? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants