pub struct EventsHandle { /* private fields */ }Expand description
Cloneable handle the axum handlers use. Reads come straight off the shared ring map; writes go through the command channel.
Implementations§
Source§impl EventsHandle
impl EventsHandle
Source§impl EventsHandle
impl EventsHandle
Sourcepub async fn read_topic(
&self,
topic: &str,
since: u64,
limit: usize,
) -> Option<ReadResult>
pub async fn read_topic( &self, topic: &str, since: u64, limit: usize, ) -> Option<ReadResult>
Read events from a topic. Returns None if the topic isn’t
known (no events ever arrived for it). For marketdata:<conid>,
callers should call Self::ensure_market_data first to register
interest.
Sourcepub async fn read_empty_topic(&self, topic: &str, since: u64) -> ReadResult
pub async fn read_empty_topic(&self, topic: &str, since: u64) -> ReadResult
What a read of a topic that has no ring yet should answer: exactly what an empty ring created right now would. The caller gets this process’s cursor space and live epoch instead of its own cursor echoed back — an echo keeps a cursor from a previous process alive, and the first real event then lands below it.
Sourcepub async fn status(&self) -> EventsStatus
pub async fn status(&self) -> EventsStatus
Snapshot of status. uptime_seconds is computed at call time
from the connector’s start instant.
Sourcepub async fn request_reconnect(&self) -> Result<bool, String>
pub async fn request_reconnect(&self) -> Result<bool, String>
Ask the connector to drop its socket and reconnect now, bypassing the backoff — the soft alternative to restarting the container when the stream has gone quiet. Returns whether a socket was up when the request was taken.
§Errors
The connector task is gone, or did not take the request within ten seconds.
Sourcepub async fn ensure_market_data(&self, conid: i64) -> Result<(), String>
pub async fn ensure_market_data(&self, conid: i64) -> Result<(), String>
Ensure the upstream WS is subscribed to market data for conid.
Idempotent; multiple callers can request the same conid and only
one upstream subscribe is sent. Returns Err if the connector
task is dead or if the subscribe send failed.
Trait Implementations§
Source§impl Clone for EventsHandle
impl Clone for EventsHandle
Source§fn clone(&self) -> EventsHandle
fn clone(&self) -> EventsHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more