TPromise

A TFuture covering the simple but common case where the result is simply set by a call to succeed()/fail().

All methods are thread-safe, but usually, succeed()/fail() are only called from a single thread (different from the thread(s) waiting for the result using the TFuture interface, though).

Constructors

this
this()
Undocumented in source.

Members

Functions

cancel
void cancel()

Marks this operation as cancelled and notifies any waiters.

complete
void complete(TFuture!ResultType future)

Marks this operation as completed and takes over the outcome of another TFuture of the same type.

completion
TAwaitable completion()
Undocumented in source. Be warned that the author may not have intended to support it.
fail
void fail(Exception exception)

Marks the operation as failed with the specified exception and notifies any waiters.

get
ResultType get()
Undocumented in source. Be warned that the author may not have intended to support it.
getException
Exception getException()
Undocumented in source. Be warned that the author may not have intended to support it.
status
S status()
Undocumented in source. Be warned that the author may not have intended to support it.
succeed
void succeed(ResultType result)

Sets the result of the operation, marks it as done, and notifies any waiters.

succeed
void succeed()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta