Package org.apache.pekko.event.japi
Class ManagedActorEventBus<E>
java.lang.Object
org.apache.pekko.event.japi.ManagedActorEventBus<E>
public abstract class ManagedActorEventBus<E>
extends Object
implements EventBus<E,ActorRef,ActorRef>
Java API: See documentation for
pekko.event.ManagedActorClassification
An EventBus where the Subscribers are ActorRefs and the Classifier is ActorRef
Means that ActorRefs "listen" to other ActorRefs
E is the Event type-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ActorRefReturns the Classifier associated with the given Eventprotected abstract intmapSize()This is a size hint for the number of Classifiers you expect to have (use powers of 2)voidPublishes the specified Event to this busbooleanAttempts to register the subscriber to the specified Classifiervoidunsubscribe(ActorRef subscriber) Attempts to deregister the subscriber from all Classifiers it may be subscribed tobooleanunsubscribe(ActorRef subscriber, ActorRef from) Attempts to deregister the subscriber from the specified Classifier
-
Constructor Details
-
ManagedActorEventBus
-
-
Method Details
-
classify
Returns the Classifier associated with the given Event -
mapSize
protected abstract int mapSize()This is a size hint for the number of Classifiers you expect to have (use powers of 2) -
publish
Description copied from interface:EventBusPublishes the specified Event to this bus -
subscribe
Description copied from interface:EventBusAttempts to register the subscriber to the specified Classifier -
unsubscribe
Description copied from interface:EventBusAttempts to deregister the subscriber from the specified Classifier- Specified by:
unsubscribein interfaceEventBus<E,ActorRef, ActorRef> - Returns:
- true if successful and false if not (because it wasn't subscribed to that Classifier, or otherwise)
-
unsubscribe
Description copied from interface:EventBusAttempts to deregister the subscriber from all Classifiers it may be subscribed to- Specified by:
unsubscribein interfaceEventBus<E,ActorRef, ActorRef>
-