|
A11 (C++ runtime)
Native C++ implementation of the A11 action and streaming runtime
|
Move-only producer for a Future result. More...
#include <cpp/a11/concurrency/future.h>
Public Member Functions | |
| Promise () | |
| Promise (const Promise &)=delete | |
| Promise & | operator= (const Promise &)=delete |
| Promise (Promise &&other) noexcept | |
| Transfer responsibility for completing or abandoning the shared state. | |
| Promise & | operator= (Promise &&other) noexcept |
Abandon this state, then take responsibility for other's state. | |
| ~Promise () | |
| Future< T > | future () const |
| Return a consumer handle sharing this promise's completion state. | |
| absl::Status | SetCancellationCallback (std::function< void()> cancel) |
| Install the operation invoked when a consumer calls Future::Cancel(). | |
| absl::Status | SetValue (T value) |
Complete successfully with value. | |
| absl::Status | SetStatus (absl::Status status) |
| Complete with a non-OK status. | |
| absl::Status | SetResult (absl::StatusOr< T > result) |
| Complete with either a value or an error, waking every observer. | |
Move-only producer for a Future result.
Obtain the consumer handle with future(), then complete the promise exactly once with SetValue(), SetStatus(), or SetResult(). Destroying an incomplete promise publishes a Cancelled status so agent pipelines cannot wait forever on an abandoned operation.
|
inline |
Transfer responsibility for completing or abandoning the shared state.
|
inline |
Return a consumer handle sharing this promise's completion state.
|
delete |
|
inlinenoexcept |
Abandon this state, then take responsibility for other's state.
|
inline |
Install the operation invoked when a consumer calls Future::Cancel().
|
inline |
Complete with either a value or an error, waking every observer.
|
inline |
Complete with a non-OK status.
|
inline |
Complete successfully with value.