Package com.google.common.eventbus
Class AsyncEventBus
- java.lang.Object
- 
- com.google.common.eventbus.EventBus
- 
- com.google.common.eventbus.AsyncEventBus
 
 
- 
 public class AsyncEventBus extends EventBus AnEventBusthat takes the Executor of your choice and uses it to dispatch events, allowing dispatch to occur asynchronously.- Since:
- 10.0
- Author:
- Cliff Biffle
 
- 
- 
Constructor SummaryConstructors Constructor Description AsyncEventBus(java.lang.String identifier, java.util.concurrent.Executor executor)Creates a new AsyncEventBus that will useexecutorto dispatch events.AsyncEventBus(java.util.concurrent.Executor executor)Creates a new AsyncEventBus that will useexecutorto dispatch events.AsyncEventBus(java.util.concurrent.Executor executor, SubscriberExceptionHandler subscriberExceptionHandler)Creates a new AsyncEventBus that will useexecutorto dispatch events.
 - 
Method Summary- 
Methods inherited from class com.google.common.eventbus.EventBusidentifier, post, register, toString, unregister
 
- 
 
- 
- 
- 
Constructor Detail- 
AsyncEventBuspublic AsyncEventBus(java.lang.String identifier, java.util.concurrent.Executor executor) Creates a new AsyncEventBus that will useexecutorto dispatch events. Assignsidentifieras the bus's name for logging purposes.- Parameters:
- 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.
 
 - 
AsyncEventBuspublic AsyncEventBus(java.util.concurrent.Executor executor, SubscriberExceptionHandler subscriberExceptionHandler) Creates a new AsyncEventBus that will useexecutorto dispatch events.- Parameters:
- 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.
- subscriberExceptionHandler- Handler used to handle exceptions thrown from subscribers. See- SubscriberExceptionHandlerfor more information.
- Since:
- 16.0
 
 - 
AsyncEventBuspublic AsyncEventBus(java.util.concurrent.Executor executor) Creates a new AsyncEventBus that will useexecutorto dispatch events.- Parameters:
- 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.
 
 
- 
 
-