forked from facebook/openr
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathZmqMonitorPoller.h
37 lines (29 loc) · 1011 Bytes
/
ZmqMonitorPoller.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <vector>
#include <fbzmq/async/ZmqEventLoop.h>
#include <fbzmq/async/ZmqTimeout.h>
#include <fbzmq/zmq/Zmq.h>
#include <thrift/lib/cpp2/protocol/Serializer.h>
namespace openr {
class ZmqMonitorPoller : public fbzmq::ZmqEventLoop {
public:
ZmqMonitorPoller(
std::vector<fbzmq::SocketUrl>& counterUrls,
std::vector<fbzmq::SocketUrl>& logSubscriberUrls,
fbzmq::Context& zmqContext);
private:
void recvPublication();
void getZmqMonitorCounters(const fbzmq::SocketUrl& zmqUrl);
std::vector<fbzmq::SocketUrl> counterUrls_;
fbzmq::Context& zmqContext_;
fbzmq::Socket<ZMQ_SUB, fbzmq::ZMQ_CLIENT> zmqSubscriber_;
apache::thrift::CompactSerializer compactSerializer_;
std::unique_ptr<fbzmq::ZmqTimeout> periodicCounterTimeout_;
}; // class ZmqMonitorPoller
} // namespace openr