pub struct SiftStream<E, T = LiveStreaming> { /* private fields */ }Expand description
SiftStream is a smart wrapper over an actual gRPC stream that makes it robust and more ergonomic to work with. Some additional behaviors that SiftStream supports are:
- Checkpointing
- Retries (disabled by default)
- Backups (disabled by default)
- Tracing and ingestion metrics
To initialize a SiftStream users will use builder::SiftStreamBuilder. Refer to the crate-level documentation for further details and examples.
Implementations§
Source§impl<E, T> SiftStream<E, T>
impl<E, T> SiftStream<E, T>
Sourcepub fn get_metrics_snapshot(&self) -> SiftStreamMetricsSnapshot
Available on crate feature metrics-unstable only.
pub fn get_metrics_snapshot(&self) -> SiftStreamMetricsSnapshot
metrics-unstable only.Retrieve a snapshot of the current metrics for this stream.
Sourcepub async fn attach_run(&mut self, run_selector: RunSelector) -> Result<()>
pub async fn attach_run(&mut self, run_selector: RunSelector) -> Result<()>
Attach a run to the stream. Any data provided through SiftStream::send after return of this function will be associated with the run.
Sourcepub fn detach_run(&mut self)
pub fn detach_run(&mut self)
Detach the run, if any, associated with the stream. Any data provided through SiftStream::send after this function is called will not be associated with a run.
Sourcepub async fn send<M>(&mut self, message: M) -> Result<()>
pub async fn send<M>(&mut self, message: M) -> Result<()>
The entry-point to send actual telemetry to Sift in the form of [Flow]s.
Sourcepub async fn send_requests<I>(&mut self, requests: I) -> Result<()>
pub async fn send_requests<I>(&mut self, requests: I) -> Result<()>
This method offers a way to send data in a manner that’s identical to the raw
gRPC service for ingestion-config based streaming.
Sourcepub fn send_requests_nonblocking<I>(&mut self, requests: I) -> Result<()>
pub fn send_requests_nonblocking<I>(&mut self, requests: I) -> Result<()>
This method offers a way to send data in a manner that’s identical to the raw
gRPC service for ingestion-config based streaming.
Trait Implementations§
Source§impl<E, T> Deref for SiftStream<E, T>
impl<E, T> Deref for SiftStream<E, T>
Auto Trait Implementations§
impl<E, T> Freeze for SiftStream<E, T>
impl<E, T = LiveStreaming> !RefUnwindSafe for SiftStream<E, T>
impl<E, T> Send for SiftStream<E, T>
impl<E, T> Sync for SiftStream<E, T>
impl<E, T> Unpin for SiftStream<E, T>
impl<E, T = LiveStreaming> !UnwindSafe for SiftStream<E, T>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request