boost::corosio::io_context
An I/O context for running asynchronous operations.
Synopsis
Declared in <boost/corosio/io_context.hpp>
class io_context
: public capy::execution_context
Description
The io_context provides an execution environment for async operations. It maintains a queue of pending work items and processes them when run() is called.
The default and unsigned constructors select the platform's native backend:
-
Windows: IOCP
-
Linux: epoll
-
BSD/macOS: kqueue
-
Other POSIX: select
The template constructor accepts a backend tag value to choose a specific backend at compile time:
Thread Safety
Distinct objects: Safe. Shared objects: Safe, if using a concurrency hint greater than 1.
Types
Name |
Description |
The executor type for this context. |
|
Abstract base class for services owned by an execution context. |
Member Functions
Name |
Description |
|
Constructors |
|
Destructor |
|
Assignment operators |
Return a pointer to the service of type T, or nullptr. |
|
Return an executor for this context. |
|
Return the memory resource used for coroutine frame allocation. |
|
Return true if a service of type T exists. |
|
Construct and add a service. |
|
Process all ready work items without blocking. |
|
Process at most one ready work item without blocking. |
|
Restart the context after being stopped. |
|
Process all pending work items. |
|
Process work items for the specified duration. |
|
Process at most one pending work item. |
|
Process at most one work item for the specified duration. |
|
Process at most one work item until the specified time. |
|
Process work items until the specified time. |
|
|
|
Signal the context to stop processing. |
|
Return whether the context has been stopped. |
|
Return a pointer to this context if it matches the requested type. |
|
Return a reference to the service of type T, creating it if needed. |
See Also
epoll_t, select_t, kqueue_t, iocp_t
Created with MrDocs