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

    // Required method
    fn batch_message_channel(
        &self,
        capacity: usize
    ) -> (Self::Sender, Self::Receiver);
}
Expand description

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

Required Associated Types§

source

type Receiver: Stream<Item = T> + Send

A future stream to receive batch messages from channels.

source

type Sender: TrySend<Message = T> + Debug

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

Required Methods§

source

fn batch_message_channel( &self, capacity: usize ) -> (Self::Sender, Self::Receiver)

Return the sender and receiver used to send batch messages.

Implementors§

source§

impl<T> RuntimeChannel<T> for AsyncStdwhere T: Debug + Send,

Available on crate feature rt-async-std only.
§

type Receiver = Receiver<T>

§

type Sender = Sender<T>

source§

impl<T> RuntimeChannel<T> for Tokiowhere T: Debug + Send,

Available on crate feature rt-tokio only.
§

type Receiver = ReceiverStream<T>

§

type Sender = Sender<T>

source§

impl<T> RuntimeChannel<T> for TokioCurrentThreadwhere T: Debug + Send,

Available on crate feature rt-tokio-current-thread only.
§

type Receiver = ReceiverStream<T>

§

type Sender = Sender<T>