VLink 2.0.0
A high-performance communication middleware
Loading...
Searching...
No Matches
vlink::DiscoveryReporter Class Reference

Background MessageLoop that reports active nodes to the discovery subsystem. More...

#include <discovery_reporter.h>

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

Public Member Functions

 DiscoveryReporter ()
 Constructs the reporter and starts its background loop.
 ~DiscoveryReporter () override
 Destructor – sends an offline notification and stops the loop.
void add (NodeImpl *node)
 Registers a NodeImpl endpoint for periodic reporting.
void remove (NodeImpl *node)
 Unregisters a NodeImpl endpoint from periodic reporting.

Static Public Member Functions

static DiscoveryReporterglobal_get ()
 Returns the process-global DiscoveryReporter singleton.

Protected Member Functions

size_t get_max_task_count () const override
 Returns the maximum queue depth.
uint32_t get_max_elapsed_time () const override
 Returns the maximum allowed task execution time in milliseconds.
void on_begin () override
 Called from the loop thread just before the first task is processed.
void on_end () override
 Called from the loop thread just after the last task has been processed.

Additional Inherited Members

 Queue implementation type. More...
 Idle strategy controlling CPU and latency trade-offs. More...
 Pre-defined task priority levels for kPriorityType loops. More...

Detailed Description

Background MessageLoop that reports active nodes to the discovery subsystem.

Automatically started and stopped by the VLink runtime. Callers should not need to manage this object directly unless building custom tooling.

Constructor & Destructor Documentation

◆ DiscoveryReporter()

vlink::DiscoveryReporter::DiscoveryReporter ( )

Constructs the reporter and starts its background loop.

Here is the caller graph for this function:

◆ ~DiscoveryReporter()

vlink::DiscoveryReporter::~DiscoveryReporter ( )
override

Destructor – sends an offline notification and stops the loop.

Member Function Documentation

◆ add()

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

Registers a NodeImpl endpoint for periodic reporting.

Called automatically by NodeImpl on construction.

Parameters
nodeNode to add.

◆ get_max_elapsed_time()

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

Returns the maximum allowed task execution time in milliseconds.

When a task exceeds this duration, on_task_timeout() is called. Returns 0 to disable timeout checking.

Returns
Maximum execution time in ms.

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.

◆ global_get()

DiscoveryReporter * vlink::DiscoveryReporter::global_get ( )
static

Returns the process-global DiscoveryReporter singleton.

Created on first call. The singleton is destroyed when the process exits.

Returns
Raw pointer to the global DiscoveryReporter.
Here is the call graph for this function:

◆ on_begin()

void vlink::DiscoveryReporter::on_begin ( )
overrideprotectedvirtual

Called from the loop thread just before the first task is processed.

Override in subclasses to perform per-thread initialisation.

Reimplemented from vlink::MessageLoop.

◆ on_end()

void vlink::DiscoveryReporter::on_end ( )
overrideprotectedvirtual

Called from the loop thread just after the last task has been processed.

Override in subclasses to perform per-thread cleanup.

Reimplemented from vlink::MessageLoop.

Here is the call graph for this function:

◆ remove()

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

Unregisters a NodeImpl endpoint from periodic reporting.

Called automatically by NodeImpl on destruction.

Parameters
nodeNode to remove.

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