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

执行顺序是否错误? #13

Open
lougw opened this issue Apr 23, 2024 · 1 comment
Open

执行顺序是否错误? #13

lougw opened this issue Apr 23, 2024 · 1 comment

Comments

@lougw
Copy link

lougw commented Apr 23, 2024

 1:源码

//OP监听器--成功
if (wrapper.getListener(OperatorEventEnum.SUCCESS) != null) {
wrapper.getListener(OperatorEventEnum.SUCCESS).forEach(t -> ((OperatorListener)t).onEvent(wrapper, OperatorEventEnum.SUCCESS));
}
wrapper.getOperatorResult().setResult(operatorResult);

2:修改后
wrapper.getOperatorResult().setResult(operatorResult);
//OP监听器--成功
if (wrapper.getListener(OperatorEventEnum.SUCCESS) != null) {
wrapper.getListener(OperatorEventEnum.SUCCESS).forEach(t -> ((OperatorListener)t).onEvent(wrapper, OperatorEventEnum.SUCCESS));
}

@ytyht226
Copy link
Owner

 1:源码

//OP监听器--成功 if (wrapper.getListener(OperatorEventEnum.SUCCESS) != null) { wrapper.getListener(OperatorEventEnum.SUCCESS).forEach(t -> ((OperatorListener)t).onEvent(wrapper, OperatorEventEnum.SUCCESS)); } wrapper.getOperatorResult().setResult(operatorResult);

2:修改后 wrapper.getOperatorResult().setResult(operatorResult); //OP监听器--成功 if (wrapper.getListener(OperatorEventEnum.SUCCESS) != null) { wrapper.getListener(OperatorEventEnum.SUCCESS).forEach(t -> ((OperatorListener)t).onEvent(wrapper, OperatorEventEnum.SUCCESS)); }

要这样修改执行顺序的考虑是:如果自定义的监听器执行异常,operatorResult就设置不上了?

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