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

No async/await is implemented without thread scheduling #16

Closed
dunmengjun opened this issue May 25, 2018 · 2 comments
Closed

No async/await is implemented without thread scheduling #16

dunmengjun opened this issue May 25, 2018 · 2 comments
Labels

Comments

@dunmengjun
Copy link

I have a doubt, I looked at your code, you use Futrue.join () method inside the Aysnc.await method to achieve the wait result returned, so there is no thread scheduling, how can we call it async/ Await?

@JoeHegarty
Copy link
Member

JoeHegarty commented May 25, 2018

That join is only present when the code has not been instrumented. This is so the code still "works" if you are running in a scenario where you can't instrument, but a warning will also be printed.

When the code gets instrumented by one of the methods described in the README all calls to Async.await are removed.

You can prove this by only including the async library during compilation but not at runtime and using the maven plugin. At runtime there will be no references to Async.await left.

EA Async does not deal with threading at all, but instead leaves that to the application. Continuations are scheduled on the thread that completed the last step.

Does that make sense?

@dunmengjun
Copy link
Author

ok,I understand what you mean, I will read your code carefully, see what you did when modifying the bytecode, haha

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

No branches or pull requests

2 participants