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

Instead of Java Vertx Futures, hand over Promises #26

Open
Narigo opened this issue Jul 24, 2013 · 1 comment
Open

Instead of Java Vertx Futures, hand over Promises #26

Narigo opened this issue Jul 24, 2013 · 1 comment

Comments

@Narigo
Copy link
Member

Narigo commented Jul 24, 2013

This would enable us to write:

def start(p: Promise[Unit]) = {
  doSomethingAsyncReturningAFuture() map { result =>
    p.success()
  } recover { ex =>
    logger.error("problem at start up!", ex)
    p.failure()
  }
}

a) We wouldn't need the Future class at all.
b) It would be more towards the Scala-way
c) Users cannot overwrite the Futures failure handler during startup. This is safer than the Java API approach (hoping the dev doesn't do stupid things ;)).

@galderz
Copy link
Contributor

galderz commented Jul 26, 2013

Hmmm, we already have an issue to provide a Future/Promises based API, see #16. We should focus related to providing such API there? :)

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