boost::corosio::timer
An asynchronous timer for coroutine I/O.
Synopsis
Declared in <boost/corosio/timer.hpp>
class timer
: public io_object
Description
This class provides asynchronous timer operations that return awaitable types. The timer can be used to schedule operations to occur after a specified duration or at a specific time point.
Each timer operation participates in the affine awaitable protocol, ensuring coroutines resume on the correct executor.
Thread Safety
Distinct objects: Safe. Shared objects: Unsafe. A timer must not have concurrent wait operations.
Semantics
Wraps platform timer facilities via the io_context reactor. Operations dispatch to OS timer APIs (timerfd, IOCP timers, kqueue EVFILT_TIMER).
Types
Name |
Description |
RAII wrapper for I/O object implementation lifetime. |
|
Forward declaration for platform‐specific implementation. |
|
Base interface for platform I/O implementations. |
|
Service interface for I/O object lifecycle management. |
|
The clock type used for time operations. |
|
The duration type for relative expiry times. |
|
The time point type for absolute expiry times. |
Member Functions
Name |
Description |
|
Constructors |
|
Destructor. |
|
Move assignment operator. |
Cancel any pending asynchronous operations. |
|
Return the execution context. |
|
Set the timer's expiry time relative to now. |
|
Set the timer's expiry time as an absolute time. |
|
Get the timer's expiry time as an absolute time. |
|
Wait for the timer to expire. |
Protected Data Members
Name |
Created with MrDocs