boost::corosio::basic_io_context::service

Abstract base class for services owned by an execution context.

Synopsis

Declared in <boost/capy/ex/execution_context.hpp>

class service;

Description

Services provide extensible functionality to an execution context. Each service type can be registered at most once. Services are created via use_service() or make_service() and are owned by the execution context for their lifetime.

Derived classes must implement the pure virtual shutdown() member function, which is called when the owning execution context is being destroyed. The shutdown() function should release resources and cancel outstanding operations without blocking.

Deriving from service

  • Implement `shutdown()` to perform cleanup.

  • Accept `execution_context&` as the first constructor parameter.

  • Optionally define `key_type` to enable base‐class lookup.

Example

struct my_service : execution_context::service
{
    explicit my_service(execution_context&) {}

protected:
    void shutdown() override
    {
        // Cancel pending operations, release resources
    }
};

Friends

Name Description

boost::capy::execution_context

See Also

execution_context

Created with MrDocs