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

demo代码连续调用两次就崩 #6

Closed
hnbc8848 opened this issue Nov 22, 2019 · 1 comment
Closed

demo代码连续调用两次就崩 #6

hnbc8848 opened this issue Nov 22, 2019 · 1 comment

Comments

@hnbc8848
Copy link

SampleApplication.java
// 这里连续调用两次就崩
new TaskTest().start();
new TaskTest().start();

@YummyLau
Copy link
Collaborator

SampleApplication

这里你用错了。
你收到的异常应该是 :Caused by: java.lang.RuntimeException: Multiple different tasks are not allowed to contain the same id 。
TaskTest本来就是一棵完整的依赖树。框架在初始化依赖树的时候,每个节点都有一个标志位为唯一,且框架支持同异步节点的依赖链,内部会根据标志进行任务同步初始。连续调用两次没有关系,前提是你要保证每个task都是唯一的。

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