VLink 2.0.0
A high-performance communication middleware
载入中...
搜索中...
未找到
discovery_viewer.h 文件参考

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

#include <cstdint>
#include <functional>
#include <memory>
#include <string>
#include <vector>
#include "../base/macros.h"
#include "../base/message_loop.h"
#include "../impl/types.h"
discovery_viewer.h 的引用(Include)关系图:

浏览该文件的源代码.

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

命名空间

详细描述

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(...)
定义 logger.h:850
注解
  • 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.