Package com.google.common.eventbus
Class Dispatcher.PerThreadQueuedDispatcher
- java.lang.Object
-
- com.google.common.eventbus.Dispatcher
-
- com.google.common.eventbus.Dispatcher.PerThreadQueuedDispatcher
-
- Enclosing class:
- Dispatcher
private static final class Dispatcher.PerThreadQueuedDispatcher extends Dispatcher
Implementation of aDispatcher.perThreadDispatchQueue()
dispatcher.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
Dispatcher.PerThreadQueuedDispatcher.Event
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ThreadLocal<java.lang.Boolean>
dispatching
Per-thread dispatch state, used to avoid reentrant event dispatching.private java.lang.ThreadLocal<java.util.Queue<Dispatcher.PerThreadQueuedDispatcher.Event>>
queue
Per-thread queue of events to dispatch.
-
Constructor Summary
Constructors Modifier Constructor Description private
PerThreadQueuedDispatcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
dispatch(java.lang.Object event, java.util.Iterator<Subscriber> subscribers)
Dispatches the givenevent
to the givensubscribers
.-
Methods inherited from class com.google.common.eventbus.Dispatcher
immediate, legacyAsync, perThreadDispatchQueue
-
-
-
-
Field Detail
-
queue
private final java.lang.ThreadLocal<java.util.Queue<Dispatcher.PerThreadQueuedDispatcher.Event>> queue
Per-thread queue of events to dispatch.
-
dispatching
private final java.lang.ThreadLocal<java.lang.Boolean> dispatching
Per-thread dispatch state, used to avoid reentrant event dispatching.
-
-
Method Detail
-
dispatch
void dispatch(java.lang.Object event, java.util.Iterator<Subscriber> subscribers)
Description copied from class:Dispatcher
Dispatches the givenevent
to the givensubscribers
.- Specified by:
dispatch
in classDispatcher
-
-