VLink  2.0.0
A high-performance communication middleware
vlink::DiscoveryReporter Class Reference

Periodic multicast broadcaster of the process's active VLink endpoints. More...

#include <discovery_reporter.h>

Inheritance diagram for vlink::DiscoveryReporter:
Collaboration diagram for vlink::DiscoveryReporter:

Public Member Functions

 DiscoveryReporter ()
 Builds the reporter, opens its UDP socket and arms the periodic timer. More...
 
 ~DiscoveryReporter () override
 Stops the loop and releases the UDP socket. More...
 
void add (NodeImpl *node)
 Registers a node so that subsequent broadcasts include it. More...
 
void remove (NodeImpl *node)
 Unregisters a node so that subsequent broadcasts exclude it. More...
 

Protected Member Functions

size_t get_max_task_count () const override
 Returns the maximum queue depth. More...
 
uint32_t get_max_elapsed_time () const override
 Returns the maximum allowed task execution time in milliseconds. More...
 
void on_begin () override
 Hook invoked once on the loop thread before the first task runs. More...
 
void on_end () override
 Hook invoked once on the loop thread after the last task runs. More...
 

Additional Inherited Members

 Internal queue implementation type. More...
 Back-pressure strategy applied when the bounded queue is at capacity. More...
 Built-in priority levels for kPriorityType loops; higher values dispatch first. More...

Detailed Description

Periodic multicast broadcaster of the process's active VLink endpoints.

Constructor & Destructor Documentation

◆ DiscoveryReporter()

vlink::DiscoveryReporter::DiscoveryReporter ( )

Builds the reporter, opens its UDP socket and arms the periodic timer.

The MessageLoop is left idle; callers are responsible for calling async_run(). The runtime-owned process reporter does this automatically.

◆ ~DiscoveryReporter()

vlink::DiscoveryReporter::~DiscoveryReporter ( )
override

Stops the loop and releases the UDP socket.

An offline notification is only emitted when offline reporting is compiled in; the default build omits it.

Member Function Documentation

◆ add()

void vlink::DiscoveryReporter::add ( NodeImpl node)

Registers a node so that subsequent broadcasts include it.

Invoked automatically by NodeImpl::init_ext().

Parameters
nodeNode endpoint to track.

◆ get_max_elapsed_time()

uint32_t vlink::DiscoveryReporter::get_max_elapsed_time ( ) const
overrideprotectedvirtual

Returns the maximum allowed task execution time in milliseconds.

Tasks exceeding this duration trigger on_task_timeout. Zero disables the check.

Returns
Maximum execution time in milliseconds.

Reimplemented from vlink::MessageLoop.

◆ get_max_task_count()

size_t vlink::DiscoveryReporter::get_max_task_count ( ) const
overrideprotectedvirtual

Returns the maximum queue depth.

Returns
kMaxTaskSize (10000) by default.

Reimplemented from vlink::MessageLoop.

◆ on_begin()

void vlink::DiscoveryReporter::on_begin ( )
overrideprotectedvirtual

Hook invoked once on the loop thread before the first task runs.

Subclasses override to perform per-thread initialisation.

Reimplemented from vlink::MessageLoop.

◆ on_end()

void vlink::DiscoveryReporter::on_end ( )
overrideprotectedvirtual

Hook invoked once on the loop thread after the last task runs.

Subclasses override to perform per-thread cleanup.

Reimplemented from vlink::MessageLoop.

◆ remove()

void vlink::DiscoveryReporter::remove ( NodeImpl node)

Unregisters a node so that subsequent broadcasts exclude it.

Invoked automatically by NodeImpl::deinit_ext().

Parameters
nodeNode endpoint to drop.

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