pub struct IpcForwardSink(Arc<ForwarderState>);Expand description
Sink that forwards events to a collector over IPC.
Events wait in a bounded pending buffer. One flush task at a time waits 250 ms, drains the
buffer, and sends the drained events as a single FlightRecorderBatch, so at most one batch
goes out per interval. Flushes do not drain while an aggregated read is in flight, so the read
still finds in pending every event the collector’s answer lacks. Send failures drop the batch.
When the buffer is full, the oldest events are dropped. Events from the IPC stack itself go to
local and are never forwarded.
Tuple Fields§
§0: Arc<ForwarderState>Implementations§
Source§impl IpcForwardSink
impl IpcForwardSink
Sourcepub fn new(
client: Arc<dyn IpcClient>,
destination: Endpoint,
capacity: NonZeroUsize,
local: Arc<CircularBuffer<FlightRecorderEvent>>,
) -> Self
pub fn new( client: Arc<dyn IpcClient>, destination: Endpoint, capacity: NonZeroUsize, local: Arc<CircularBuffer<FlightRecorderEvent>>, ) -> Self
Create a sink forwarding to destination, holding at most capacity unsent events.
Events from the IPC stack are stored in local instead.
fn enqueue(&self, event: FlightRecorderEvent)
fn schedule_flush(&self)
Sourceasync fn read_aggregated(
&self,
cancellation_token: Option<CancellationToken>,
) -> Vec<FlightRecorderEvent>
async fn read_aggregated( &self, cancellation_token: Option<CancellationToken>, ) -> Vec<FlightRecorderEvent>
Read the collector’s events followed by this context’s IPC events and unsent events. The collector’s events are omitted if it refuses, fails, or does not answer in time.
Trait Implementations§
Source§impl Clone for IpcForwardSink
impl Clone for IpcForwardSink
Source§fn clone(&self) -> IpcForwardSink
fn clone(&self) -> IpcForwardSink
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl FlightRecorderSink for IpcForwardSink
impl FlightRecorderSink for IpcForwardSink
Source§fn push(&self, event: FlightRecorderEvent)
fn push(&self, event: FlightRecorderEvent)
Auto Trait Implementations§
impl !RefUnwindSafe for IpcForwardSink
impl !UnwindSafe for IpcForwardSink
impl Freeze for IpcForwardSink
impl Send for IpcForwardSink
impl Sync for IpcForwardSink
impl Unpin for IpcForwardSink
impl UnsafeUnpin for IpcForwardSink
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more