boost::corosio::epoll_context

I/O context using Linux epoll for event multiplexing.

Synopsis

class epoll_context
    : public basic_io_context

Description

This context provides an execution environment for async operations using the Linux epoll API for efficient I/O event notification. It maintains a queue of pending work items and processes them when run() is called.

Thread Safety

Distinct objects: Safe. Shared objects: Safe, if using a concurrency hint greater than 1.

Example

epoll_context ctx;
auto ex = ctx.get_executor();
run_async(ex)(my_coroutine());
ctx.run();  // Process all queued work

Base Classes

Name Description

basic_io_context

Base class for I/O context implementations.

Types

Name

Description

executor_type

The executor type for this context.

service

Abstract base class for services owned by an execution context.

Member Functions

Name

Description

epoll_context [constructor]

Constructors

~epoll_context [destructor]

Destructor.

operator= [deleted]

Assignment operators

find_service

Return a pointer to the service of type T, or nullptr.

get_executor

Return an executor for this context.

get_frame_allocator

Return the memory resource used for coroutine frame allocation.

has_service

Return true if a service of type T exists.

make_service

Construct and add a service.

poll

Process all ready work items without blocking.

poll_one

Process at most one ready work item without blocking.

restart

Restart the context after being stopped.

run

Process all pending work items.

run_for

Process work items for the specified duration.

run_one

Process at most one pending work item.

run_one_for

Process at most one work item for the specified duration.

run_one_until

Process at most one work item until the specified time.

run_until

Process work items until the specified time.

set_frame_allocator

set_frame_allocator overloads

stop

Signal the context to stop processing.

stopped

Return whether the context has been stopped.

use_service

Return a reference to the service of type T, creating it if needed.

Protected Member Functions

Name

Description

destroy

Destroy all services.

shutdown

Shut down all services.

Protected Data Members

Name

sched_

Created with MrDocs