Awaits for the pledge to be completed, then returns the final value.
Completes this pledge with the given value.
Completes this pledge with the given value.
It's a protocol violation to try and complete the pledge twice. The second time will end in error.
Pledge
is a value that can be completed later, much like a ScalaPromise
, but pure, to be used in describing laws that require the observation of side effects.The internal implementation effectively wraps a Scala
Promise
, so it has the same contract:Example: