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

I don't know why Schedulers class NewThreadTask implements Callable #6391

Closed
guohaiping521 opened this issue Jan 29, 2019 · 2 comments
Closed

Comments

@guohaiping521
Copy link

static final class NewThreadTask implements Callable {
@OverRide
public Scheduler call() throws Exception {
return NewThreadHolder.DEFAULT;
}
}

change to

getInstance(){
return NewThreadHolder.DEFAULT;
}

the first What are the benefits?

@akarnokd
Copy link
Member

It works around a problem with premature initialization of schedulers when they are overridden but the default implementation is not required nor is desirable to get initialized in the first place. This several indirections allow this to happen.

You can follow the Git Blame to find the relevant PRs/issues, such as #4585.

@guohaiping521
Copy link
Author

Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants