pub struct TelemetryConsumer { /* private fields */ }Implementations§
Source§impl TelemetryConsumer
impl TelemetryConsumer
pub async fn new(redis_url: &str) -> Result<Self, Box<dyn Error + Send + Sync>>
pub fn with_stream_key(self, stream_key: &str) -> Self
pub fn with_consumer_group(self, group: &str) -> Self
pub async fn start_consuming<F, Fut>( &self, handler: F, cancellation_token: CancellationToken, ) -> Result<JoinHandle<()>, Box<dyn Error + Send + Sync>>
Sourcepub async fn read_single_batch(
&self,
) -> Result<Vec<UsageRecord>, Box<dyn Error + Send + Sync>>
pub async fn read_single_batch( &self, ) -> Result<Vec<UsageRecord>, Box<dyn Error + Send + Sync>>
Read a single batch of messages from the stream.
Note: This method always reads from the beginning of the stream (ID “0”)
and is intended for one-time reads or testing purposes only. For production
use with repeated batch reads, use start_consuming which leverages
consumer groups for proper message tracking and acknowledgment.
Auto Trait Implementations§
impl Freeze for TelemetryConsumer
impl RefUnwindSafe for TelemetryConsumer
impl Send for TelemetryConsumer
impl Sync for TelemetryConsumer
impl Unpin for TelemetryConsumer
impl UnsafeUnpin for TelemetryConsumer
impl UnwindSafe for TelemetryConsumer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more