com.google.common.eventbus
| Constructor and Description |
|---|
AsyncEventBus(java.util.concurrent.Executor executor)
Creates a new AsyncEventBus that will use
executor to dispatch
events. |
AsyncEventBus(java.lang.String identifier,
java.util.concurrent.Executor executor)
Creates a new AsyncEventBus that will use
executor to dispatch
events. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
dispatch(java.lang.Object event,
com.google.common.eventbus.EventHandler handler)
|
protected void |
dispatchQueuedEvents()
Dispatch
events in the order they were posted, regardless of
the posting thread. |
protected void |
enqueueEvent(java.lang.Object event,
com.google.common.eventbus.EventHandler handler)
Queue the
event for dispatch during
EventBus.dispatchQueuedEvents(). |
newHandlerSet, post, register, unregisterpublic AsyncEventBus(java.lang.String identifier,
java.util.concurrent.Executor executor)
executor to dispatch
events. Assigns identifier as the bus's name for logging purposes.identifier - short name for the bus, for logging purposes.executor - Executor to use to dispatch events. It is the caller's
responsibility to shut down the executor after the last event has
been posted to this event bus.public AsyncEventBus(java.util.concurrent.Executor executor)
executor to dispatch
events.executor - Executor to use to dispatch events. It is the caller's
responsibility to shut down the executor after the last event has
been posted to this event bus.protected void enqueueEvent(java.lang.Object event,
com.google.common.eventbus.EventHandler handler)
EventBusevent for dispatch during
EventBus.dispatchQueuedEvents(). Events are queued in-order of occurrence
so they can be dispatched in the same order.enqueueEvent in class EventBusprotected void dispatchQueuedEvents()
events in the order they were posted, regardless of
the posting thread.dispatchQueuedEvents in class EventBus