-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
给状态机模块增加一些新功能 #343
给状态机模块增加一些新功能 #343
Conversation
1. 增加com.alibaba.cola.statemachine.StateMachine#verify方法 用来判断当前状态能否响应某个事件 2. 增加com.alibaba.cola.statemachine.builder.StateMachineBuilder#setFailoverCallback 用来增加在状态流转没有命中当前配置的规则时执行的回调 接口定义 com.alibaba.cola.statemachine.builder.FailoverCallback 默认为NumbFailoverCallbackImpl,与当前行为一样,什么都不做。 另外内置AlertFailoverCallbackImpl,用于抛出异常TransitionFailoverException
1. 增加com.alibaba.cola.statemachine.StateMachine#verify方法 用来判断当前状态能否响应某个事件 2. 增加com.alibaba.cola.statemachine.builder.StateMachineBuilder#setFailoverCallback 用来增加在状态流转没有命中当前配置的规则时执行的回调 接口定义 com.alibaba.cola.statemachine.builder.FailoverCallback 默认为NumbFailoverCallbackImpl,与当前行为一样,什么都不做。 另外内置AlertFailoverCallbackImpl,用于抛出异常TransitionFailoverException
挺好。提个意见,把FailoverCallback改成FailCallback,这里不是故障恢复,只是出错回调 |
好的,我改一下 |
这里不是故障恢复,只是出错回调
最新的提交已经把FailoverCallback改成了FailCallback。 |
Hello Both, |
Hi,Frank is the maintainer of this repo.I'm glad this PR is useful for you. |
b9652a6
to
d7f15aa
Compare
Merged |
增加com.alibaba.cola.statemachine.StateMachine#verify方法
用来判断当前状态能否响应某个事件
增加com.alibaba.cola.statemachine.builder.StateMachineBuilder#setFailCallback
用来增加在状态流转没有命中当前配置的规则时执行的回调,可以解决 #335 的需求
接口定义 com.alibaba.cola.statemachine.builder.FailCallback
默认为NumbFailCallback,与当前行为一样,什么都不做。
另外内置AlertFailCallback,用于抛出异常TransitionFailException