VLink 2.0.0
A high-performance communication middleware
Loading...
Searching...
No Matches
discovery_viewer.h File Reference

Real-time view of all active VLink endpoints discovered on the current host or network. More...

#include <cstdint>
#include <functional>
#include <memory>
#include <string>
#include <vector>
#include "../base/macros.h"
#include "../base/message_loop.h"
#include "../impl/types.h"
Include dependency graph for discovery_viewer.h:

Go to the source code of this file.

Classes

 Background MessageLoop that aggregates live VLink endpoint discovery data. More...
 Information about one process that hosts a VLink endpoint. More...
 Aggregated discovery entry for one VLink URL. More...

Namespaces

Detailed Description

Real-time view of all active VLink endpoints discovered on the current host or network.

DiscoveryViewer subscribes to DiscoveryReporter broadcasts and maintains a live list of all known VLink processes and their endpoints. It is used by the vlink-cli tool and by monitoring applications.

Each entry in the Info list describes one topic URL and the set of processes that publish or subscribe to it. Entries are sorted for stable display.

Filter modes
FilterType Shows
kFilterNone All discovered endpoints
kFilterAvailable Only endpoints that have at least one live process
kFilterNative Only endpoints from the same host
Usage
viewer.register_callback([](const std::vector<vlink::DiscoveryViewer::Info>& list) {
for (auto& info : list) {
VLOG_I("URL: ", info.url, " type: ", info.type);
}
});
viewer.async_run();
#define VLOG_I(...)
Definition logger.h:850
Note
  • The callback is invoked on the viewer's event loop thread.
  • Use global_get() to share one viewer across the application.
  • Endpoints that do not send a heartbeat within a timeout are removed automatically.