public abstract class ActorEventBus<E> extends java.lang.Object implements EventBus<E,ActorRef,ActorRef>
ActorClassification
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 and Description |
|---|
ActorEventBus() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract ActorRef |
classify(E event)
Returns the Classifier associated with the given Event
|
protected abstract int |
mapSize()
This is a size hint for the number of Classifiers you expect to have (use powers of 2)
|
void |
publish(E event)
Publishes the specified Event to this bus
|
boolean |
subscribe(ActorRef subscriber,
ActorRef to)
Attempts to register the subscriber to the specified Classifier
|
void |
unsubscribe(ActorRef subscriber)
Attempts to deregister the subscriber from all Classifiers it may be subscribed to
|
boolean |
unsubscribe(ActorRef subscriber,
ActorRef from)
Attempts to deregister the subscriber from the specified Classifier
|
protected abstract int mapSize()
protected abstract ActorRef classify(E event)
public boolean subscribe(ActorRef subscriber, ActorRef to)
EventBuspublic boolean unsubscribe(ActorRef subscriber, ActorRef from)
EventBusunsubscribe in interface EventBus<E,ActorRef,ActorRef>public void unsubscribe(ActorRef subscriber)
EventBusunsubscribe in interface EventBus<E,ActorRef,ActorRef>