receiver/phase¶
-
module
receiver.
phase
¶ Phase message receiver.
Receives messages labeled for a specific phase. Contains inbox for each participant. Routes received message to inbox of sender. Discards messages from unrecognized senders.
Provide:
- Iterable of all participant public keys as hex strings.
- Optionally
Receiver
instance to receive discarded messages. - Optionally factory function returning
Inbox
instances.
Inbox defaults to
FifoInbox
.-
class
receiver.phase.
PhaseReceiver
(participants, discarder=null, inboxFactory=null)¶ Arguments: - participants (Iterable.<HexString>) – Participant public keys.
- discarder (Receiver) – Message receiver that handles discarded messages.
- inboxFactory (function) – Factory function providing Inbox instances.
-
receiver.phase.PhaseReceiver.
participantInboxes
¶ type: Map.<HexString, Inbox>
Participant inboxes.
Index participant public key. Value participant inbox.
-
receiver.phase.PhaseReceiver.
submit
(message)¶ Arguments: - message (object) –