trait Publisher extends Reactor
Notifies registered reactions when an event is published. Publishers are also reactors and listen to themselves per default as a convenience.
In order to reduce memory leaks, reactions are weakly referenced by default,
unless they implement Reactions.StronglyReferenced
. That way,
the lifetime of reactions are more easily bound to the registering object,
which are reactors in common client code and hold strong references to their
reactions. As a result, reactors can be garbage collected even though they
still have reactions registered at some publisher, but not vice versa
since reactors (strongly) reference publishers they are interested in.
- Alphabetic
- By Inheritance
- Publisher
- Reactor
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
def
deafTo(ps: Publisher*): Unit
Installed reaction won't receive events from the given publisher anylonger.
Installed reaction won't receive events from the given publisher anylonger.
- Definition Classes
- Reactor
-
def
listenTo(ps: Publisher*): Unit
Listen to the given publisher as long as
deafTo
isn't called for them.Listen to the given publisher as long as
deafTo
isn't called for them.- Definition Classes
- Reactor
-
def
publish(e: Event): Unit
Notify all registered reactions.
-
val
reactions: Reactions
All reactions of this reactor.
All reactions of this reactor.
- Definition Classes
- Reactor