You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 ;)).
The text was updated successfully, but these errors were encountered:
This would enable us to write:
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 ;)).
The text was updated successfully, but these errors were encountered: