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

Completed futures should not park #8

Closed

Conversation

doctorpangloss
Copy link

@doctorpangloss doctorpangloss commented Dec 28, 2022

Motivation:

Already completed futures should not park the thread. Currently, they do. This can improve performance.

This also resolves an ordering issue in the default event loop context.

Benjamin Berman added 2 commits December 28, 2022 12:57
Signed-off-by: Benjamin Berman <[email protected]>
Signed-off-by: Benjamin Berman <[email protected]>
var flag = new AtomicInteger();
async.run(v -> {
var completed = Future.succeededFuture("HELLO");
vertx.getOrCreateContext().runOnContext(v2 -> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this we can simply call testComplete after the await

var flag = new AtomicInteger();
async.run(v -> {
var completed = Future.failedFuture("FAILED");
vertx.getOrCreateContext().runOnContext(v2 -> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this, we can simply call testComplete in the catch block

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

Successfully merging this pull request may close these issues.

2 participants