mpsc-completion#
An abstract multi-producer single-receiver sequencing-protocol for converging / synchronizing multiple processes as
completed
Protocol#
The objective of this protocol is to allow a receiver of messages to know when every participant has completed their work.
- The receiever ought make available an idempotent
mpsc-completion-hellomessage and ampsc-completion-donethat consumers can easily send.- An optional
nameattribute may be provided to identify the participant. if the name is heirarchical, colon separation is recommended.
- An optional
- Each client transmits a
mpsc-completion-hellomessage when it begins it's process, at an early opportunity. - Clients send data or do work as usual.
- Clients send a
mpsc-completion-donemessage when they terminate - Receiever knows to expect no new messages if it has the same number of
mpsc-completion-hellomessages asmpsc-completion-donemessages.
Notes:#
- Supervisor processes that can spawn producing processes should fire a
mpsc-completion-helloif they wish to keep the channel open.
Other completion related mentions#
ExtendableEvent#waitUntilinServiceWorkersallows multiple event listeners to signal when they are done processing an event, allowing for long running execution before the event is fully processed / consumed.