Skip to content

Commit

Permalink
Add a comment explaining the Mutex inside the receiver stream
Browse files Browse the repository at this point in the history
  • Loading branch information
akoshelev committed Apr 16, 2024
1 parent 99f708b commit 7e09115
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ipa-core/src/helpers/gateway/receive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ pub type UR = UnorderedReceiver<
/// Stream of records received from a peer shard.
#[derive(Clone)]
pub struct ShardReceiveStream(
/// Using a mutex here may not be necessary - there is always a single caller that polls it,
/// and there may be an observer from stall detection that wants to know the state of it.
/// There could be a better way to share the state and make sure the owning reference is stored
/// inside the map of receivers.
pub(super) Arc<Mutex<<ShardTransportImpl as Transport>::RecordsStream>>,
);

Expand Down

0 comments on commit 7e09115

Please sign in to comment.