Skip to content

Commit

Permalink
code review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
neonphog committed Feb 2, 2024
1 parent 0741954 commit 9f8c3d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/tx5-core/src/evt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ impl std::fmt::Debug for EventPermit {
}
}

/// Generic event sender.
/// Sender side of an explicitly bounded channel that lets us send
/// bounded (backpressured) events, but unbounded error messages.
pub struct EventSend<E: From<Error>> {
limit: Arc<tokio::sync::Semaphore>,
send: tokio::sync::mpsc::UnboundedSender<(E, EventPermit)>,
Expand Down Expand Up @@ -67,7 +68,8 @@ impl<E: From<Error>> EventSend<E> {
}
}

/// Generic event receiver.
/// Receiver side of an explicitly bounded channel that lets us send
/// bounded (backpressured) events, but unbounded error messages.
pub struct EventRecv<E: From<Error>>(
tokio::sync::mpsc::UnboundedReceiver<(E, EventPermit)>,
);
Expand Down

0 comments on commit 9f8c3d9

Please sign in to comment.