44#include < chrono> // milliseconds
55#include < cstdint>
66#include < string>
7+ #include < utility> // pair
78#include < vector>
89
910#include " databento/datetime.hpp" // UnixNanos
@@ -22,10 +23,12 @@ class ILogReceiver;
2223class LiveBlocking {
2324 public:
2425 LiveBlocking (ILogReceiver* log_receiver, std::string key, std::string dataset,
25- bool send_ts_out, VersionUpgradePolicy upgrade_policy);
26+ bool send_ts_out, VersionUpgradePolicy upgrade_policy,
27+ std::chrono::seconds heartbeat_interval);
2628 LiveBlocking (ILogReceiver* log_receiver, std::string key, std::string dataset,
2729 std::string gateway, std::uint16_t port, bool send_ts_out,
28- VersionUpgradePolicy upgrade_policy);
30+ VersionUpgradePolicy upgrade_policy,
31+ std::chrono::seconds heartbeat_interval);
2932 /*
3033 * Getters
3134 */
@@ -36,6 +39,11 @@ class LiveBlocking {
3639 std::uint16_t Port () const { return port_; }
3740 bool SendTsOut () const { return send_ts_out_; }
3841 VersionUpgradePolicy UpgradePolicy () const { return upgrade_policy_; }
42+ // The the first member of the pair will be true, when the heartbeat interval
43+ // was overridden.
44+ std::pair<bool , std::chrono::seconds> HeartbeatInterval () const {
45+ return {heartbeat_interval_.count () > 0 , heartbeat_interval_};
46+ }
3947
4048 /*
4149 * Methods
@@ -50,8 +58,8 @@ class LiveBlocking {
5058 SType stype_in, UnixNanos start);
5159 void Subscribe (const std::vector<std::string>& symbols, Schema schema,
5260 SType stype_in, const std::string& start);
53- void Subscribe (const std::vector<std::string>& symbols, Schema schema ,
54- SType stype_in, bool use_snapshot );
61+ void SubscribeWithSnapshot (const std::vector<std::string>& symbols,
62+ Schema schema, SType stype_in );
5563 // Notifies the gateway to start sending messages for all subscriptions.
5664 //
5765 // This method should only be called once per instance.
@@ -95,6 +103,7 @@ class LiveBlocking {
95103 bool send_ts_out_;
96104 std::uint8_t version_{};
97105 VersionUpgradePolicy upgrade_policy_;
106+ std::chrono::seconds heartbeat_interval_;
98107 detail::TcpClient client_;
99108 // Must be 8-byte aligned for records
100109 alignas (RecordHeader) std::array<char , kMaxStrLen > read_buffer_{};
0 commit comments