mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 20:57:10 +00:00
Resolve merge conflicts
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
pub use eth2::types::{EventKind, SseBlock, SseFinalizedCheckpoint, SseHead};
|
||||
use tokio::sync::broadcast;
|
||||
use tokio::sync::broadcast::{error::SendError, Receiver, Sender};
|
||||
use tokio::sync::broadcast::{Receiver, Sender, error::SendError};
|
||||
use tracing::trace;
|
||||
use types::EthSpec;
|
||||
|
||||
@@ -11,6 +11,7 @@ pub struct ServerSentEventHandler<E: EthSpec> {
|
||||
single_attestation_tx: Sender<EventKind<E>>,
|
||||
block_tx: Sender<EventKind<E>>,
|
||||
blob_sidecar_tx: Sender<EventKind<E>>,
|
||||
data_column_sidecar_tx: Sender<EventKind<E>>,
|
||||
finalized_tx: Sender<EventKind<E>>,
|
||||
head_tx: Sender<EventKind<E>>,
|
||||
exit_tx: Sender<EventKind<E>>,
|
||||
@@ -38,6 +39,7 @@ impl<E: EthSpec> ServerSentEventHandler<E> {
|
||||
let (single_attestation_tx, _) = broadcast::channel(capacity);
|
||||
let (block_tx, _) = broadcast::channel(capacity);
|
||||
let (blob_sidecar_tx, _) = broadcast::channel(capacity);
|
||||
let (data_column_sidecar_tx, _) = broadcast::channel(capacity);
|
||||
let (finalized_tx, _) = broadcast::channel(capacity);
|
||||
let (head_tx, _) = broadcast::channel(capacity);
|
||||
let (exit_tx, _) = broadcast::channel(capacity);
|
||||
@@ -59,6 +61,7 @@ impl<E: EthSpec> ServerSentEventHandler<E> {
|
||||
single_attestation_tx,
|
||||
block_tx,
|
||||
blob_sidecar_tx,
|
||||
data_column_sidecar_tx,
|
||||
finalized_tx,
|
||||
head_tx,
|
||||
exit_tx,
|
||||
@@ -102,6 +105,10 @@ impl<E: EthSpec> ServerSentEventHandler<E> {
|
||||
.blob_sidecar_tx
|
||||
.send(kind)
|
||||
.map(|count| log_count("blob sidecar", count)),
|
||||
EventKind::DataColumnSidecar(_) => self
|
||||
.data_column_sidecar_tx
|
||||
.send(kind)
|
||||
.map(|count| log_count("data_column_sidecar", count)),
|
||||
EventKind::FinalizedCheckpoint(_) => self
|
||||
.finalized_tx
|
||||
.send(kind)
|
||||
@@ -184,6 +191,10 @@ impl<E: EthSpec> ServerSentEventHandler<E> {
|
||||
self.blob_sidecar_tx.subscribe()
|
||||
}
|
||||
|
||||
pub fn subscribe_data_column_sidecar(&self) -> Receiver<EventKind<E>> {
|
||||
self.data_column_sidecar_tx.subscribe()
|
||||
}
|
||||
|
||||
pub fn subscribe_finalized(&self) -> Receiver<EventKind<E>> {
|
||||
self.finalized_tx.subscribe()
|
||||
}
|
||||
@@ -260,6 +271,10 @@ impl<E: EthSpec> ServerSentEventHandler<E> {
|
||||
self.blob_sidecar_tx.receiver_count() > 0
|
||||
}
|
||||
|
||||
pub fn has_data_column_sidecar_subscribers(&self) -> bool {
|
||||
self.data_column_sidecar_tx.receiver_count() > 0
|
||||
}
|
||||
|
||||
pub fn has_finalized_subscribers(&self) -> bool {
|
||||
self.finalized_tx.receiver_count() > 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user