Promise is an object which can be completed with a value or failed with an exception.
A promise should always eventually be completed, whether for success or failure, in order to avoid unintended resource retention for any associated Futures' callbacks or transformations.
| Supertypes |
|---|
Future containing the value of this promise.
Returns whether the promise has already been completed with a value or an exception.
Note: Using this method may result in non-deterministic concurrent programs.
| Returns |
|
|---|
Tries to complete the promise with either a value or the exception.
Note: Using this method may result in non-deterministic concurrent programs.
| Returns | If the promise has already been completed returns |
|---|
Completes the promise with either an exception or a value.
| Value parameters |
|
|---|
Completes this promise with the specified future, once that future is completed.
| Returns | This promise |
|---|
Completes the promise with an exception.
| Value parameters |
|
|---|
Completes the promise with a value.
| Value parameters |
|
|---|
Tries to complete the promise with an exception.
Note: Using this method may result in non-deterministic concurrent programs.
| Returns | If the promise has already been completed returns |
|---|
Tries to complete the promise with a value.
Note: Using this method may result in non-deterministic concurrent programs.
| Returns | If the promise has already been completed returns |
|---|
© 2002-2022 EPFL, with contributions from Lightbend.
Licensed under the Apache License, Version 2.0.
https://scala-lang.org/api/3.2.0/scala/concurrent/Promise.html