databento / databento-rs

The official Rust client library for Databento
https://databento.com
Apache License 2.0
41 stars 2 forks source link

Clarify whether `databento::live::Subscription::start` is `ts_event` or `ts_recv` #16

Closed yongqli closed 6 months ago

yongqli commented 6 months ago

Currently it is not clear whether databento::live::Subscription::start refers to ts_event or ts_recv, which makes it tricky to resume from a disconnect in a perfectly correct way. I have been told that only ts_recv is guaranteed to be monotonic, but dbn::record::Record::raw_index_ts() currently is defined to be self.header().ts_event.

threecgreen commented 6 months ago

start for live subscriptions is always based around ts_event to be consistent across hosts. This will be documented in the next release.

All record types with a ts_recv define raw_index_ts to be ts_recv. The code you're referring to is only the default for the trait.

threecgreen commented 6 months ago

This is gap in documentation is addressed in 3ce12947230a0167b3ac9e4029420c89678fa63b, which will be included in the next release