electronicarts / ea-async

EA Async implements async-await methods in the JVM.

Home Page:https://go.ea.com/ea-async

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No async/await is implemented without thread scheduling

dunmengjun opened this issue · comments

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?

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?

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