the proposed approach
Some notable qualities about channels, to contrast against the other approaches:
- When no callbacks are registered, messages queue up
- Callbacks can either consume all messages (receive-all) or just some messages (receive, receive-while)
The combination of these two features means that we can choose between a push or pull model, depending on the situation. It also saves us from the transaction/side-effect issue, since can divert messages into a receiver-less channel while in a transaction, and then use those messages to achieve side effects outside the transaction.