Skip to content

Commit

Permalink
chore: use rx over tx for receiver name
Browse files Browse the repository at this point in the history
  • Loading branch information
hai-rise committed Feb 25, 2025
1 parent ee7e3fe commit 18b5d9e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions crates/net/network/src/session/active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub(crate) struct ActiveSession<N: NetworkPrimitives> {
/// A message that needs to be delivered to the session manager
pub(crate) pending_message_to_session: Option<ActiveSessionMessage<N>>,
/// Incoming internal requests which are delegated to the remote peer.
pub(crate) internal_request_tx: Fuse<ReceiverStream<PeerRequest<N>>>,
pub(crate) internal_request_rx: Fuse<ReceiverStream<PeerRequest<N>>>,
/// All requests sent to the remote peer we're waiting on a response
pub(crate) inflight_requests: FxHashMap<u64, InflightRequest<PeerRequest<N>>>,
/// All requests that were sent by the remote peer and we're waiting on an internal response
Expand Down Expand Up @@ -547,7 +547,7 @@ impl<N: NetworkPrimitives> Future for ActiveSession<N> {

let deadline = this.request_deadline();

while let Poll::Ready(Some(req)) = this.internal_request_tx.poll_next_unpin(cx) {
while let Poll::Ready(Some(req)) = this.internal_request_rx.poll_next_unpin(cx) {
progress = true;
this.on_internal_peer_request(req, deadline);
}
Expand Down Expand Up @@ -960,7 +960,7 @@ mod tests {
"network_active_session",
),
pending_message_to_session: None,
internal_request_tx: ReceiverStream::new(messages_rx).fuse(),
internal_request_rx: ReceiverStream::new(messages_rx).fuse(),
inflight_requests: Default::default(),
conn,
queued_outgoing: QueuedOutgoingMessages::new(Gauge::noop()),
Expand Down
2 changes: 1 addition & 1 deletion crates/net/network/src/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ impl<N: NetworkPrimitives> SessionManager<N> {
commands_rx: ReceiverStream::new(commands_rx),
to_session_manager: self.active_session_tx.clone(),
pending_message_to_session: None,
internal_request_tx: ReceiverStream::new(messages_rx).fuse(),
internal_request_rx: ReceiverStream::new(messages_rx).fuse(),
inflight_requests: Default::default(),
conn,
queued_outgoing: QueuedOutgoingMessages::new(
Expand Down

0 comments on commit 18b5d9e

Please sign in to comment.