class Executor

Defined at line 35 of file ../../sdk/lib/async/include/lib/async/cpp/executor.h

An asynchronous task executor that wraps an |async_dispatcher_t|.

This allows asynchronous tasks, such as promises, to be evaluated alongside

other asynchronous operations managed by the |async_dispatcher_t|.

Public Methods

void Executor (async_dispatcher_t * dispatcher)

Wraps the specified dispatcher.

|dispatcher| must not be null and it must outlive the executor itself.

Defined at line 13 of file ../../sdk/lib/async/executor.cc

void ~Executor ()

Destroys the executor along with all of its remaining scheduled tasks

that have yet to complete.

Defined at line 16 of file ../../sdk/lib/async/executor.cc

void schedule_task (fpromise::pending_task task)

Schedules a task for eventual execution by the executor.

This method is thread-safe.

Defined at line 18 of file ../../sdk/lib/async/executor.cc

fpromise::promise<> MakeDelayedPromise (zx::duration duration)

Returns a promise that will complete after the specified duration.

The countdown starts when this method is called.

Defined at line 23 of file ../../sdk/lib/async/executor.cc

fpromise::promise<> MakePromiseForTime (zx::time deadline)

Returns a promise that will complete on or after |deadline|.

Defined at line 32 of file ../../sdk/lib/async/executor.cc

fpromise::promise<zx_packet_signal_t, zx_status_t> MakePromiseWaitHandle (zx::unowned_handle object, zx_signals_t trigger, uint32_t options)

Makes a promise that waits for one or more signals on a handle.

|object|, |trigger|, and |options| must be valid according to the

corresponding arguments to |async::WaitOnce()|.

|object| must remain valid at least until |trigger| is sent. The returned promise will only

have access to the data that was sent up to the point that |object| received |trigger|.

Defined at line 41 of file ../../sdk/lib/async/executor.cc

async_dispatcher_t * dispatcher ()

Gets the executor's |async_dispatcher_t|, never null.

Defined at line 47 of file ../../sdk/lib/async/include/lib/async/cpp/executor.h

void Executor (const Executor & )

Defined at line 54 of file ../../sdk/lib/async/include/lib/async/cpp/executor.h

void Executor (Executor && )

Defined at line 55 of file ../../sdk/lib/async/include/lib/async/cpp/executor.h

Executor & operator= (const Executor & )

Defined at line 56 of file ../../sdk/lib/async/include/lib/async/cpp/executor.h

Executor & operator= (Executor && )

Defined at line 57 of file ../../sdk/lib/async/include/lib/async/cpp/executor.h