Module roopes::prelude::publisher_subscriber
source · Expand description
This module implements the
Publisher-Subscriber pattern. In this model,
a Publisher
contains a list of
Subscriber
s. When a message is
delivered to the Publisher
, it is then
delegated directly to all its Subscriber
s,
one at a time. Typically, implementations are
dynamic, in that Subscriber
s are able to
be dded or removed at will by the client
code - these features are delineated
separately in the DetachablePublisher
and
AttachablePublisher
traits, but can be
implemented by any Publisher
, and together
as a MutablePublisher
.
![publisher subscriber diagram][publisher-subscriber-diagram]
Modules
- Provides a heap-based
Subscriber
which redirectspublisher_subscriber::Subscriber::receive
calls to a delegateSubscriber
. - Exposes the
Publisher
,Subscriber
,AttachablePublisher
andDetachablePublisher
types at the library level.
Structs
Traits
- Allows
Subscriber
s to be added to the implementingPublisher
. - Allows
Subscriber
s to be removed from the implementingPublisher
. - A
Publisher
distributes messages it receives to theSubscriber
s which it currently holds. Subscriber
s can be attached to, and will receive messages from,Publisher
s.