You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Messenger only provides Send and Receive for msg handling and both methods are unified for any peer. This forces protocols to be implemented in one way only, where msgs are sent or rcvd in only one place. However, there are protocols that would benefit from splitting logic per each peer independently.
Design
// The peer structure stores required channels to send/recv msgstypePeerstruct {}
// Send mimics Messenger's Send but without peer id.func (p*Peer) Send(context.Context, serde.Message) <-chanerr// Receive mimics Messenger's Receive but without peer id.// Multiple Receive users will compete for msgs, as they are not duplicated.func (p*Peer) Receive(context.Context) serde.Message// Events chan will only return event's of the peer.func (p*Peer) Events() <-chanPeerEvent// Add a new method to the Messenger to return a Peer.// Once a Peer instantiated, new msgs incoming from the peer can only be rcvd through Peer.Receive. // Messenger.Receive will still be able to receive new msgs from other peers, but not from this one.func (m*MessengerPeer(peer.ID) *Peer
The text was updated successfully, but these errors were encountered:
Context
Messenger only provides
Send and Receive
for msg handling and both methods are unified for any peer. This forces protocols to be implemented in one way only, where msgs are sent or rcvd in only one place. However, there are protocols that would benefit from splitting logic per each peer independently.Design
The text was updated successfully, but these errors were encountered: