Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# Changelog

## 0.48.0 - 2026-02-18

### Enhancements
- Added `SlowReaderBehavior` enum and `LiveBuilder::SetSlowReaderBehavior()` to configure
gateway behavior when client falls behind
- Added `SlowReaderBehavior()` getter to `LiveBlocking` and `LiveThreaded`

### Bug fixes
- Added conversion for missing schemas for function `RTypeFromSchema`
- Added explicit optional construction in `json_helpers.hpp` (credit: Enrico Detoma)

## 0.47.0 - 2026-02-04

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

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.24..4.2)

project(
databento
VERSION 0.47.0
VERSION 0.48.0
LANGUAGES CXX
DESCRIPTION "Official Databento client library"
)
Expand Down
11 changes: 11 additions & 0 deletions include/databento/enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ enum class DatasetCondition : std::uint8_t {
Missing,
};

// Live session parameter which controls gateway behavior when the client
// falls behind real time.
enum class SlowReaderBehavior : std::uint8_t {
// Send a warning but continue reading.
Warn = 0,
// Skip records to catch up.
Skip = 1,
};

// A record type sentinel.
namespace r_type {
enum RType : std::uint8_t {
Expand Down Expand Up @@ -662,6 +671,7 @@ const char* ToString(SplitDuration duration_interval);
const char* ToString(Delivery delivery);
const char* ToString(JobState state);
const char* ToString(DatasetCondition condition);
const char* ToString(SlowReaderBehavior slow_reader_behavior);
const char* ToString(RType r_type);
const char* ToString(Side side);
const char* ToString(Action action);
Expand All @@ -688,6 +698,7 @@ std::ostream& operator<<(std::ostream& out, SplitDuration duration_interval);
std::ostream& operator<<(std::ostream& out, Delivery delivery);
std::ostream& operator<<(std::ostream& out, JobState state);
std::ostream& operator<<(std::ostream& out, DatasetCondition condition);
std::ostream& operator<<(std::ostream& out, SlowReaderBehavior slow_reader_behavior);
std::ostream& operator<<(std::ostream& out, RType r_type);
std::ostream& operator<<(std::ostream& out, Side side);
std::ostream& operator<<(std::ostream& out, Action action);
Expand Down
5 changes: 5 additions & 0 deletions include/databento/live.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <chrono>
#include <cstddef>
#include <cstdint>
#include <optional>
#include <string>

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

/*
* Build a live client instance
Expand Down Expand Up @@ -80,5 +84,6 @@ class LiveBuilder {
std::size_t buffer_size_;
std::string user_agent_ext_;
Compression compression_{Compression::None};
std::optional<SlowReaderBehavior> slow_reader_behavior_{};
};
} // namespace databento
10 changes: 8 additions & 2 deletions include/databento/live_blocking.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ class LiveBlocking {
return heartbeat_interval_;
}
databento::Compression Compression() const { return compression_; }
std::optional<databento::SlowReaderBehavior> SlowReaderBehavior() const {
return slow_reader_behavior_;
}
const std::vector<LiveSubscription>& Subscriptions() const { return subscriptions_; }
std::vector<LiveSubscription>& Subscriptions() { return subscriptions_; }

Expand Down Expand Up @@ -95,13 +98,15 @@ class LiveBlocking {
bool send_ts_out, VersionUpgradePolicy upgrade_policy,
std::optional<std::chrono::seconds> heartbeat_interval,
std::size_t buffer_size, std::string user_agent_ext,
databento::Compression compression);
databento::Compression compression,
std::optional<databento::SlowReaderBehavior> slow_reader_behavior);
LiveBlocking(ILogReceiver* log_receiver, std::string key, std::string dataset,
std::string gateway, std::uint16_t port, bool send_ts_out,
VersionUpgradePolicy upgrade_policy,
std::optional<std::chrono::seconds> heartbeat_interval,
std::size_t buffer_size, std::string user_agent_ext,
databento::Compression compression);
databento::Compression compression,
std::optional<databento::SlowReaderBehavior> slow_reader_behavior);

std::string DetermineGateway() const;
std::uint64_t Authenticate();
Expand All @@ -128,6 +133,7 @@ class LiveBlocking {
const VersionUpgradePolicy upgrade_policy_;
const std::optional<std::chrono::seconds> heartbeat_interval_;
const databento::Compression compression_;
const std::optional<databento::SlowReaderBehavior> slow_reader_behavior_;
detail::LiveConnection connection_;
std::uint32_t sub_counter_{};
std::vector<LiveSubscription> subscriptions_;
Expand Down
7 changes: 5 additions & 2 deletions include/databento/live_threaded.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class LiveThreaded {
VersionUpgradePolicy UpgradePolicy() const;
std::optional<std::chrono::seconds> HeartbeatInterval() const;
databento::Compression Compression() const;
std::optional<databento::SlowReaderBehavior> SlowReaderBehavior() const;
const std::vector<LiveSubscription>& Subscriptions() const;
std::vector<LiveSubscription>& Subscriptions();

Expand Down Expand Up @@ -109,13 +110,15 @@ class LiveThreaded {
bool send_ts_out, VersionUpgradePolicy upgrade_policy,
std::optional<std::chrono::seconds> heartbeat_interval,
std::size_t buffer_size, std::string user_agent_ext,
databento::Compression compression);
databento::Compression compression,
std::optional<databento::SlowReaderBehavior> slow_reader_behavior);
LiveThreaded(ILogReceiver* log_receiver, std::string key, std::string dataset,
std::string gateway, std::uint16_t port, bool send_ts_out,
VersionUpgradePolicy upgrade_policy,
std::optional<std::chrono::seconds> heartbeat_interval,
std::size_t buffer_size, std::string user_agent_ext,
databento::Compression compression);
databento::Compression compression,
std::optional<databento::SlowReaderBehavior> slow_reader_behavior);

// unique_ptr to be movable
std::unique_ptr<Impl> impl_;
Expand Down
78 changes: 0 additions & 78 deletions live.hpp

This file was deleted.

138 changes: 0 additions & 138 deletions live_blocking.hpp

This file was deleted.

23 changes: 0 additions & 23 deletions live_subscription.hpp

This file was deleted.

Loading
Loading