mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-09 15:28:01 -05:00
added EventSender to FullNode type (#14268)
Co-authored-by: Roman Krasiuk <rokrassyuk@gmail.com> Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@@ -4,8 +4,8 @@ use tracing::trace;
|
||||
|
||||
const DEFAULT_SIZE_BROADCAST_CHANNEL: usize = 2000;
|
||||
|
||||
/// A bounded broadcast channel for a task.
|
||||
#[derive(Debug, Clone)]
|
||||
/// A bounded multi-producer, multi-consumer broadcast channel.
|
||||
#[derive(Debug)]
|
||||
pub struct EventSender<T> {
|
||||
/// The sender part of the broadcast channel
|
||||
sender: Sender<T>,
|
||||
@@ -20,6 +20,12 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Clone for EventSender<T> {
|
||||
fn clone(&self) -> Self {
|
||||
Self { sender: self.sender.clone() }
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Clone + Send + Sync + 'static> EventSender<T> {
|
||||
/// Creates a new `EventSender`.
|
||||
pub fn new(events_channel_size: usize) -> Self {
|
||||
|
||||
Reference in New Issue
Block a user