private static final class ListenerCallQueue.PerListenerQueue<L>
extends java.lang.Object
implements java.lang.Runnable
This class is very similar to SequentialExecutor
with the exception that events can
be added without necessarily executing immediately.
Modifier and Type | Field and Description |
---|---|
(package private) java.util.concurrent.Executor |
executor |
(package private) boolean |
isThreadScheduled |
(package private) java.util.Queue<java.lang.Object> |
labelQueue |
(package private) L |
listener |
(package private) java.util.Queue<ListenerCallQueue.Event<L>> |
waitQueue |
Constructor and Description |
---|
PerListenerQueue(L listener,
java.util.concurrent.Executor executor) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
add(ListenerCallQueue.Event<L> event,
java.lang.Object label)
Enqueues a event to be run.
|
(package private) void |
dispatch()
Dispatches all listeners enqueued prior to this call, serially and in
order.
|
void |
run() |
final L listener
final java.util.concurrent.Executor executor
final java.util.Queue<ListenerCallQueue.Event<L>> waitQueue
final java.util.Queue<java.lang.Object> labelQueue
boolean isThreadScheduled
PerListenerQueue(L listener, java.util.concurrent.Executor executor)
void add(ListenerCallQueue.Event<L> event, java.lang.Object label)
void dispatch()
public void run()
run
in interface java.lang.Runnable