Top Description Constructors Methods
com.google.common.eventbus

public Class AsyncEventBus

extends EventBus
Class Inheritance
Annotations
@ElementTypesAreNonnullByDefault
Imports
java.util.concurrent.Executor

An EventBus that takes the Executor of your choice and uses it to dispatch events, allowing dispatch to occur asynchronously.
Author
Cliff Biffle
Since
10.0

Constructor Summary

AccessConstructor and Description
public
AsyncEventBus(String
short name for the bus, for logging purposes.
identifier
,
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.
executor
)

Creates a new AsyncEventBus that will use executor to dispatch events.

public
AsyncEventBus(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.
executor
,
SubscriberExceptionHandler
Handler used to handle exceptions thrown from subscribers. See SubscriberExceptionHandler for more information.
subscriberExceptionHandler
)

Creates a new AsyncEventBus that will use executor to dispatch events.

public
AsyncEventBus(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.
executor
)

Creates a new AsyncEventBus that will use executor to dispatch events.

Method Summary

Inherited from com.google.common.eventbus.EventBus:
executorhandleSubscriberExceptionidentifierpostregistertoStringunregister

Constructor Detail

AsyncEventBusback to summary
public AsyncEventBus(String identifier, Executor executor)

Creates a new AsyncEventBus that will use executor to dispatch events. Assigns identifier as the bus's name for logging purposes.

Parameters
identifier:String

short name for the bus, for logging purposes.

executor: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.

AsyncEventBusback to summary
public AsyncEventBus(Executor executor, SubscriberExceptionHandler subscriberExceptionHandler)

Creates a new AsyncEventBus that will use executor to dispatch events.

Parameters
executor: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:SubscriberExceptionHandler

Handler used to handle exceptions thrown from subscribers. See SubscriberExceptionHandler for more information.

Since
16.0
AsyncEventBusback to summary
public AsyncEventBus(Executor executor)

Creates a new AsyncEventBus that will use executor to dispatch events.

Parameters
executor: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.