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

parallel fire event, get exception: The state machine is already terminated. #135

Open
SuperChrisliu opened this issue Aug 11, 2022 · 1 comment

Comments

@SuperChrisliu
Copy link

SuperChrisliu commented Aug 11, 2022

在项目中并发调用fsm.fire(event), 可能其他线程触发了final event,当前线程再触发事件就会得到这个异常The state machine is already terminated.并发状态下难以保证调用fire的时候状态机不是terminated状态,怎么处理这样的问题?增加一个terminated callback?

@SuperChrisliu
Copy link
Author

去看了一下spring statemachine,触发事件sendEvent是返回true or false的,我觉得fsm.fire(event)也应该增加返回值,而不是直接抛出异常

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

1 participant