class WaitOnce
Defined at line 129 of file ../../sdk/lib/async/include/lib/async/cpp/wait.h
An asynchronous wait whose handler is bound to a |async::WaitOnce::Handler| function, but that
handler can only be called once, at which point the handler is destroyed.
This type of wait is particularly useful for handlers that will delete the wait object itself
since the handler will be moved to the stack prior to being called.
Public Methods
void WaitOnce (zx_handle_t object, zx_signals_t trigger, uint32_t options)
Defined at line 86 of file ../../sdk/lib/async/wait.cc
void ~WaitOnce ()
Defined at line 89 of file ../../sdk/lib/async/wait.cc
zx_status_t Begin (async_dispatcher_t * dispatcher, Handler handler)
Begins asynchronously waiting for the object to receive one or more of
the trigger signals. Invokes the handler when the wait completes.
The wait's handler will be invoked exactly once unless the wait is canceled.
When the dispatcher is shutting down (being destroyed), the handlers of
all remaining waits will be invoked with a status of |ZX_ERR_CANCELED|.
As the handler is destroyed on each invocation, a new handler must be supplied at each call
to Begin().
Returns |ZX_OK| if the wait was successfully begun.
Returns |ZX_ERR_ACCESS_DENIED| if the object does not have |ZX_RIGHT_WAIT|.
Returns |ZX_ERR_BAD_STATE| if the dispatcher is shutting down.
Returns |ZX_ERR_NOT_SUPPORTED| if not supported by the dispatcher.
Defined at line 97 of file ../../sdk/lib/async/wait.cc