Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions crates/shim/src/asynchronous/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use std::collections::HashMap;
use lazy_static::lazy_static;
use log::error;
use tokio::sync::{
mpsc::{channel, Receiver, Sender},
mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender},
Mutex,
};

Expand Down Expand Up @@ -68,17 +68,17 @@ pub struct Monitor {

pub(crate) struct Subscriber {
pub(crate) topic: Topic,
pub(crate) tx: Sender<ExitEvent>,
pub(crate) tx: UnboundedSender<ExitEvent>,
}

pub struct Subscription {
pub id: i64,
pub rx: Receiver<ExitEvent>,
pub rx: UnboundedReceiver<ExitEvent>,
}

impl Monitor {
pub fn subscribe(&mut self, topic: Topic) -> Result<Subscription> {
let (tx, rx) = channel::<ExitEvent>(128);
let (tx, rx) = unbounded_channel::<ExitEvent>();
let id = self.seq_id;
self.seq_id += 1;
let subscriber = Subscriber {
Expand Down Expand Up @@ -120,7 +120,6 @@ impl Monitor {
subject: subject.clone(),
exit_code,
})
.await
.map_err(other_error!(e, "failed to send exit code"));
results.push(res);
}
Expand Down