boost::capy::delay_awaitable

IoAwaitable returned by delay.

Synopsis

Declared in <boost/capy/delay.hpp>

class delay_awaitable;

Description

Suspends the calling coroutine until the deadline elapses or the environment's stop token is activated, whichever comes first. Resumption is always posted through the executor, never inline on the timer thread.

Not intended to be named directly; use the delay factory function instead.

Cancellation

If stop_requested() is true before suspension, the coroutine resumes immediately without scheduling a timer. If stop is requested while suspended, the stop callback claims the resume and posts it through the executor; the pending timer is cancelled on the next await_resume or destructor call.

Thread Safety

A single delay_awaitable must not be awaited concurrently. Multiple independent delay() calls on the same execution_context are safe and share one timer thread.

Member Functions

Name

Description

delay_awaitable [constructor] [deleted]

Constructors

~delay_awaitable [destructor]

Destructor

operator= [deleted]

Assignment operators

await_ready

await_resume

await_suspend

Non-Member Functions

Name

Description

delay

Suspend the current coroutine for a duration.

See Also

delay, timeout

Created with MrDocs