@Beta public class AsyncEventBus extends EventBus
EventBus
that takes the Executor of your choice and uses it to
dispatch events, allowing dispatch to occur asynchronously.Constructor and Description |
---|
AsyncEventBus(Executor executor)
Creates a new AsyncEventBus that will use
executor to dispatch
events. |
AsyncEventBus(String identifier,
Executor executor)
Creates a new AsyncEventBus that will use
executor to dispatch
events. |
Modifier and Type | Method and Description |
---|---|
protected void |
dispatchQueuedEvents()
Dispatch
events in the order they were posted, regardless of
the posting thread. |
post, register, unregister
public AsyncEventBus(String identifier, 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(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 dispatchQueuedEvents()
events
in the order they were posted, regardless of
the posting thread.Copyright © 2010-2013. All Rights Reserved.