ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Member Functions | List of all members
subscription_handler Class Referencefinal

Message handler for subscription protocol messages. More...

#include <subscription_handler.hpp>

Inheritance diagram for subscription_handler:
Inheritance graph
Collaboration diagram for subscription_handler:
Collaboration graph

Public Member Functions

 subscription_handler (std::shared_ptr< subscription_manager > manager)
 Construct a subscription handler.
 
boost::asio::awaitable< std::expected< std::vector< std::byte >, messaging::error_code > > handle_message (messaging::message_type type, std::span< const std::byte > payload, const std::string &remote_address) override
 Handle a subscription protocol message.
 

Detailed Description

Message handler for subscription protocol messages.

Handles subscribe_request and unsubscribe_request messages from clients, delegating to the subscription_manager to track subscriptions.

Note: notification messages are server-initiated and are sent via the subscription_manager's notify() method, not through this handler.

Constructor & Destructor Documentation

◆ subscription_handler()

subscription_handler ( std::shared_ptr< subscription_manager manager)
explicit

Construct a subscription handler.

Parameters
managerShared subscription manager for tracking subscriptions.

Member Function Documentation

◆ handle_message()

boost::asio::awaitable< std::expected< std::vector< std::byte >, messaging::error_code > > handle_message ( messaging::message_type  type,
std::span< const std::byte >  payload,
const std::string &  remote_address 
)
overridevirtual

Handle a subscription protocol message.

Parameters
typeThe message type (subscribe_request or unsubscribe_request).
payloadThe message payload.
remote_addressThe remote endpoint address of the client.
Returns
Expected containing response payload, or error code.

Implements message_handler.