CommRaT 2.0.0
C++20 Real-Time Messaging Framework
Loading...
Searching...
No Matches
commrat::WorkLoopHandler< ModuleType > Class Template Reference

Phase 7: Work Loop Handler CRTP Mixin. More...

#include <commrat/module/lifecycle/work_loop_handler.hpp>

Inheritance diagram for commrat::WorkLoopHandler< ModuleType >:
commrat::Module< UserRegistry, OutputSpec_, InputSpec_, CommandTypes... >

Protected Member Functions

void work_loop ()
 Main work loop - handles subscription protocol messages.
 

Detailed Description

template<typename ModuleType>
class commrat::WorkLoopHandler< ModuleType >

Phase 7: Work Loop Handler CRTP Mixin.

Handles subscription protocol messages on the WORK mailbox:

  • SubscribeRequest: Producer receives subscription from consumer
  • SubscribeReply: Consumer receives acknowledgment from producer
  • UnsubscribeRequest: Producer receives unsubscription from consumer

This is the main dispatch loop for the subscription protocol. Runs in a dedicated thread spawned by LifecycleManager.

Template Parameters
ModuleTypeThe derived Module class (CRTP)

Definition at line 24 of file work_loop_handler.hpp.

Member Function Documentation

◆ work_loop()

template<typename ModuleType >
void commrat::WorkLoopHandler< ModuleType >::work_loop ( )
inlineprotected

Main work loop - handles subscription protocol messages.

Runs continuously while module is running, processing subscription messages on the WORK mailbox. Uses blocking receive (no polling).

Message types handled:

  • SubscribeRequest: Add subscriber to output list
  • SubscribeReply: Confirm subscription established
  • UnsubscribeRequest: Remove subscriber from output list

Definition at line 37 of file work_loop_handler.hpp.


The documentation for this class was generated from the following file: