Skip to main content

RuntimeChannel

Trait RuntimeChannel 

pub trait RuntimeChannel: Runtime {
    type Receiver<T: Debug + Send>: Stream<Item = T> + Send;
    type Sender<T: Debug + Send>: TrySend<Message = T> + Debug;

    // Required method
    fn batch_message_channel<T>(
        &self,
        capacity: usize,
    ) -> (Self::Sender<T>, Self::Receiver<T>)
       where T: Debug + Send;
}
Available on crate features experimental_async_runtime and opentelemetry only.
Expand description

RuntimeChannel is an extension to Runtime. Currently, it provides a channel that is used by the log and span batch processors.

Required Associated Types§

type Receiver<T: Debug + Send>: Stream<Item = T> + Send

A future stream to receive batch messages from channels.

type Sender<T: Debug + Send>: TrySend<Message = T> + Debug

A batch messages sender that can be sent across threads safely.

Required Methods§

fn batch_message_channel<T>( &self, capacity: usize, ) -> (Self::Sender<T>, Self::Receiver<T>)
where T: Debug + Send,

Return the sender and receiver used to send batch messages.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

§

impl RuntimeChannel for Tokio

Available on crate feature rt-tokio only.
§

type Receiver<T: Debug + Send> = ReceiverStream<T>

§

type Sender<T: Debug + Send> = Sender<T>