public class EventStreamUnsubscriber extends java.lang.Object implements Actor
Watches all actors which subscribe on the given eventStream, and unsubscribes them from it when they are Terminated.
Assumptions note: We do not guarantee happens-before in the EventStream when 2 threads subscribe(a) / unsubscribe(a) on the same actor, thus the messages sent to this actor may appear to be reordered - this is fine, because the worst-case is starting to needlessly watch the actor which will not cause trouble for the stream. This is a trade-off between slowing down subscribe calls * because of the need of linearizing the history message sequence and the possibility of sometimes watching a few actors too much - we opt for the 2nd choice here.
Modifier and Type | Class and Description |
---|---|
static class |
EventStreamUnsubscriber.Register |
static class |
EventStreamUnsubscriber.Register$ |
static class |
EventStreamUnsubscriber.UnregisterIfNoMoreSubscribedChannels |
static class |
EventStreamUnsubscriber.UnregisterIfNoMoreSubscribedChannels$ |
Actor.emptyBehavior$, Actor.ignoringBehavior$
Constructor and Description |
---|
EventStreamUnsubscriber(EventStream eventStream,
boolean debug) |
Modifier and Type | Method and Description |
---|---|
void |
preStart()
User overridable callback.
|
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
receive()
This defines the initial actor behavior, it must return a partial function
with the actor logic.
|
static ActorRef |
start(ActorSystem system,
EventStream stream) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, postRestart, postStop, preRestart, self, sender, supervisorStrategy, unhandled
public EventStreamUnsubscriber(EventStream eventStream, boolean debug)
public static ActorRef start(ActorSystem system, EventStream stream)
public void preStart()
Actor