com.netflix.eventbus.spi
Class CatchAllSubscriber
java.lang.Object
com.netflix.eventbus.spi.CatchAllSubscriber
public final class CatchAllSubscriber
- extends java.lang.Object
A special subscriber that receives all events published to EventBus. This is always registered with eventbus
but is disabled. In order to enable this subscriber call
EventBus.enableCatchAllSubscriber(java.util.concurrent.BlockingQueue)
with the sink (receiver) for all events.
This subscriber will only call BlockingQueue.offer(Object) on this sink to avoid any sort
of blocking. Any events for which the offer call fails are rejected.
As any other EventBus subscriber, this subscriber is async i.e. any events received by this subscriber are
pushed by the eventbus in async mode. The queue size for this is SUBSCRIBER_QUEUE_SIZE and
there is no batching done for events to reduce memory overheads.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SUBSCRIBER_QUEUE_SIZE
public static final int SUBSCRIBER_QUEUE_SIZE
- See Also:
- Constant Field Values
CatchAllSubscriber
public CatchAllSubscriber()
receive
public void receive(java.lang.Object event)
enable
public boolean enable(java.util.concurrent.BlockingQueue sink)
disable
public void disable()
isEnabled
public boolean isEnabled()