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

给状态机模块增加一些新功能 #343

Merged
merged 6 commits into from
Nov 4, 2022

Conversation

Ivan97
Copy link
Contributor

@Ivan97 Ivan97 commented Sep 15, 2022

  1. 增加com.alibaba.cola.statemachine.StateMachine#verify方法
    用来判断当前状态能否响应某个事件

  2. 增加com.alibaba.cola.statemachine.builder.StateMachineBuilder#setFailCallback
    用来增加在状态流转没有命中当前配置的规则时执行的回调,可以解决 #335 的需求
    接口定义 com.alibaba.cola.statemachine.builder.FailCallback
    默认为NumbFailCallback,与当前行为一样,什么都不做。
    另外内置AlertFailCallback,用于抛出异常TransitionFailException

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
@CLAassistant
Copy link

CLAassistant commented Sep 15, 2022

CLA assistant check
All committers have signed the CLA.

@significantfrank
Copy link
Collaborator

挺好。提个意见,把FailoverCallback改成FailCallback,这里不是故障恢复,只是出错回调

@Ivan97
Copy link
Contributor Author

Ivan97 commented Oct 10, 2022

挺好。提个意见,把FailoverCallback改成FailCallback,这里不是故障恢复,只是出错回调

好的,我改一下

这里不是故障恢复,只是出错回调
@Ivan97
Copy link
Contributor Author

Ivan97 commented Oct 10, 2022

挺好。提个意见,把FailoverCallback改成FailCallback,这里不是故障恢复,只是出错回调

最新的提交已经把FailoverCallback改成了FailCallback。
涉及到这个接口及其实现类的字段、注释等也一并修改了。

@steelcg
Copy link

steelcg commented Oct 12, 2022

Hello Both,
The method verify() is extremely useful. Is there a timetable for the upgrade?

@Ivan97
Copy link
Contributor Author

Ivan97 commented Oct 12, 2022

Hello Both,

The method verify() is extremely useful. Is there a timetable for the upgrade?

Hi,Frank is the maintainer of this repo.I'm glad this PR is useful for you.

@oldratlee oldratlee force-pushed the master branch 2 times, most recently from b9652a6 to d7f15aa Compare October 14, 2022 12:35
@significantfrank significantfrank merged commit 49903c9 into alibaba:master Nov 4, 2022
@significantfrank
Copy link
Collaborator

Hello Both, The method verify() is extremely useful. Is there a timetable for the upgrade?

Merged

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

Successfully merging this pull request may close these issues.

4 participants