-
Notifications
You must be signed in to change notification settings - Fork 0
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
thenApplyAsync #336
Comments
When chaining ten.thenApplyAsync(plus(1)) // `plus(1)` executes only after `ten` has arrived (immediate because it's a completed future)
.thenApplyAsync(plus(50)) // `plus(50)` executes only after the previous `plus(1)` has been executed
.thenApplyAsync(plus(20)).join(); // `plus(20)` executes only after the previous `plus(20)` has been executed Then is because By the way, a little misnomer is that For our module, it's not really useful? An example use case for the |
Interesting note about thenApplyAsync vs thenApply! So to have lesser latency between 61 and 81, should the code be modified as below, keeping the spirit that the final sum is 81?
Edit: forgot semicolons |
Hi there,
I modified a question from a past year paper to understand how
thenApplyAsync
works.Output is
with some latency before the printing of both 61 and 81.
I see why there is a latency before the printing of 61, I don't really understand why there is latency too before the printing of 81.
Would appreciate some help! Thanks in advance:)
The text was updated successfully, but these errors were encountered: