Skip to content

Commit 95d8f5c

Browse files
authored
VER: Release 0.48.0
2 parents e4d9979 + 9302295 commit 95d8f5c

20 files changed

Lines changed: 225 additions & 406 deletions

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
# Changelog
22

3+
## 0.48.0 - 2026-02-18
4+
5+
### Enhancements
6+
- Added `SlowReaderBehavior` enum and `LiveBuilder::SetSlowReaderBehavior()` to configure
7+
gateway behavior when client falls behind
8+
- Added `SlowReaderBehavior()` getter to `LiveBlocking` and `LiveThreaded`
9+
10+
### Bug fixes
11+
- Added conversion for missing schemas for function `RTypeFromSchema`
12+
- Added explicit optional construction in `json_helpers.hpp` (credit: Enrico Detoma)
13+
314
## 0.47.0 - 2026-02-04
415

516
### Enhancements
617
- Added Zstd compression support to live clients which can be enabled with
7-
`LiveBuilder::SetCompression()`. It's disabled by default
18+
`LiveBuilder::SetCompression()`. It's disabled by default
819
- Added `Compression()` getter to `LiveBlocking` and `LiveThreaded`
920
- Upgraded default `httplib` version to 0.30.1
1021

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.24..4.2)
66

77
project(
88
databento
9-
VERSION 0.47.0
9+
VERSION 0.48.0
1010
LANGUAGES CXX
1111
DESCRIPTION "Official Databento client library"
1212
)

include/databento/enums.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ enum class DatasetCondition : std::uint8_t {
4848
Missing,
4949
};
5050

51+
// Live session parameter which controls gateway behavior when the client
52+
// falls behind real time.
53+
enum class SlowReaderBehavior : std::uint8_t {
54+
// Send a warning but continue reading.
55+
Warn = 0,
56+
// Skip records to catch up.
57+
Skip = 1,
58+
};
59+
5160
// A record type sentinel.
5261
namespace r_type {
5362
enum RType : std::uint8_t {
@@ -662,6 +671,7 @@ const char* ToString(SplitDuration duration_interval);
662671
const char* ToString(Delivery delivery);
663672
const char* ToString(JobState state);
664673
const char* ToString(DatasetCondition condition);
674+
const char* ToString(SlowReaderBehavior slow_reader_behavior);
665675
const char* ToString(RType r_type);
666676
const char* ToString(Side side);
667677
const char* ToString(Action action);
@@ -688,6 +698,7 @@ std::ostream& operator<<(std::ostream& out, SplitDuration duration_interval);
688698
std::ostream& operator<<(std::ostream& out, Delivery delivery);
689699
std::ostream& operator<<(std::ostream& out, JobState state);
690700
std::ostream& operator<<(std::ostream& out, DatasetCondition condition);
701+
std::ostream& operator<<(std::ostream& out, SlowReaderBehavior slow_reader_behavior);
691702
std::ostream& operator<<(std::ostream& out, RType r_type);
692703
std::ostream& operator<<(std::ostream& out, Side side);
693704
std::ostream& operator<<(std::ostream& out, Action action);

include/databento/live.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include <chrono>
44
#include <cstddef>
5+
#include <cstdint>
6+
#include <optional>
57
#include <string>
68

79
#include "databento/enums.hpp" // VersionUpgradePolicy
@@ -53,6 +55,8 @@ class LiveBuilder {
5355
LiveBuilder& ExtendUserAgent(std::string extension);
5456
// Sets the compression mode for the read stream.
5557
LiveBuilder& SetCompression(Compression compression);
58+
// Sets the behavior of the gateway when the client falls behind real time.
59+
LiveBuilder& SetSlowReaderBehavior(SlowReaderBehavior slow_reader_behavior);
5660

5761
/*
5862
* Build a live client instance
@@ -80,5 +84,6 @@ class LiveBuilder {
8084
std::size_t buffer_size_;
8185
std::string user_agent_ext_;
8286
Compression compression_{Compression::None};
87+
std::optional<SlowReaderBehavior> slow_reader_behavior_{};
8388
};
8489
} // namespace databento

include/databento/live_blocking.hpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ class LiveBlocking {
4545
return heartbeat_interval_;
4646
}
4747
databento::Compression Compression() const { return compression_; }
48+
std::optional<databento::SlowReaderBehavior> SlowReaderBehavior() const {
49+
return slow_reader_behavior_;
50+
}
4851
const std::vector<LiveSubscription>& Subscriptions() const { return subscriptions_; }
4952
std::vector<LiveSubscription>& Subscriptions() { return subscriptions_; }
5053

@@ -95,13 +98,15 @@ class LiveBlocking {
9598
bool send_ts_out, VersionUpgradePolicy upgrade_policy,
9699
std::optional<std::chrono::seconds> heartbeat_interval,
97100
std::size_t buffer_size, std::string user_agent_ext,
98-
databento::Compression compression);
101+
databento::Compression compression,
102+
std::optional<databento::SlowReaderBehavior> slow_reader_behavior);
99103
LiveBlocking(ILogReceiver* log_receiver, std::string key, std::string dataset,
100104
std::string gateway, std::uint16_t port, bool send_ts_out,
101105
VersionUpgradePolicy upgrade_policy,
102106
std::optional<std::chrono::seconds> heartbeat_interval,
103107
std::size_t buffer_size, std::string user_agent_ext,
104-
databento::Compression compression);
108+
databento::Compression compression,
109+
std::optional<databento::SlowReaderBehavior> slow_reader_behavior);
105110

106111
std::string DetermineGateway() const;
107112
std::uint64_t Authenticate();
@@ -128,6 +133,7 @@ class LiveBlocking {
128133
const VersionUpgradePolicy upgrade_policy_;
129134
const std::optional<std::chrono::seconds> heartbeat_interval_;
130135
const databento::Compression compression_;
136+
const std::optional<databento::SlowReaderBehavior> slow_reader_behavior_;
131137
detail::LiveConnection connection_;
132138
std::uint32_t sub_counter_{};
133139
std::vector<LiveSubscription> subscriptions_;

include/databento/live_threaded.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class LiveThreaded {
5555
VersionUpgradePolicy UpgradePolicy() const;
5656
std::optional<std::chrono::seconds> HeartbeatInterval() const;
5757
databento::Compression Compression() const;
58+
std::optional<databento::SlowReaderBehavior> SlowReaderBehavior() const;
5859
const std::vector<LiveSubscription>& Subscriptions() const;
5960
std::vector<LiveSubscription>& Subscriptions();
6061

@@ -109,13 +110,15 @@ class LiveThreaded {
109110
bool send_ts_out, VersionUpgradePolicy upgrade_policy,
110111
std::optional<std::chrono::seconds> heartbeat_interval,
111112
std::size_t buffer_size, std::string user_agent_ext,
112-
databento::Compression compression);
113+
databento::Compression compression,
114+
std::optional<databento::SlowReaderBehavior> slow_reader_behavior);
113115
LiveThreaded(ILogReceiver* log_receiver, std::string key, std::string dataset,
114116
std::string gateway, std::uint16_t port, bool send_ts_out,
115117
VersionUpgradePolicy upgrade_policy,
116118
std::optional<std::chrono::seconds> heartbeat_interval,
117119
std::size_t buffer_size, std::string user_agent_ext,
118-
databento::Compression compression);
120+
databento::Compression compression,
121+
std::optional<databento::SlowReaderBehavior> slow_reader_behavior);
119122

120123
// unique_ptr to be movable
121124
std::unique_ptr<Impl> impl_;

live.hpp

Lines changed: 0 additions & 78 deletions
This file was deleted.

live_blocking.hpp

Lines changed: 0 additions & 138 deletions
This file was deleted.

live_subscription.hpp

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)