Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
fix: cert-delivery test, forward subscription view
Browse files Browse the repository at this point in the history
  • Loading branch information
gruberb committed Jul 26, 2023
1 parent 2b31655 commit cc829c3
Show file tree
Hide file tree
Showing 2 changed files with 318 additions and 308 deletions.
16 changes: 13 additions & 3 deletions crates/topos-tce-broadcast/src/double_echo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,26 @@ impl DoubleEcho {
/// the message
pub(crate) async fn run(
mut self,
subscriptions_view_receiver: mpsc::Receiver<SubscriptionsView>,
mut subscriptions_view_receiver: mpsc::Receiver<SubscriptionsView>,
task_manager_message_receiver: mpsc::Receiver<DoubleEchoCommand>,
) {
let mut task_completion =
self.spawn_task_manager(subscriptions_view_receiver, task_manager_message_receiver);
let (forwarding_subscriptions_sender, forwarding_subscriptions_receiver) =
mpsc::channel(2048);
let mut task_completion = self.spawn_task_manager(
forwarding_subscriptions_receiver,
task_manager_message_receiver,
);

info!("DoubleEcho started");

let shutdowned: Option<oneshot::Sender<()>> = loop {
tokio::select! {
biased;

Some(new_subscriptions_view) = subscriptions_view_receiver.recv() => {
forwarding_subscriptions_sender.send(new_subscriptions_view.clone()).await.unwrap();
self.subscriptions = new_subscriptions_view;
}

shutdown = self.shutdown.recv() => {
warn!("Double echo shutdown signal received {:?}", shutdown);
Expand Down
Loading

0 comments on commit cc829c3

Please sign in to comment.