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, std::shared_ptr< eventing::service::event_channel_registry > registry)
 Construct a subscription handler.
 
boost::asio::awaitable< std::expected< std::vector< std::byte >, ores::utility::serialization::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, unsubscribe_request, and list_event_channels_request messages from clients, delegating to the subscription_manager to track subscriptions and the event_channel_registry for channel discovery.

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,
std::shared_ptr< eventing::service::event_channel_registry registry 
)

Construct a subscription handler.

Parameters
managerShared subscription manager for tracking subscriptions.
registryShared event channel registry for channel discovery.

Member Function Documentation

◆ handle_message()

boost::asio::awaitable< std::expected< std::vector< std::byte >, ores::utility::serialization::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.