Class ClientCalls.ThreadlessExecutor
- All Implemented Interfaces:
Serializable, Iterable<Runnable>, Collection<Runnable>, Executor, Queue<Runnable>
- Enclosing class:
ClientCalls
private static final class ClientCalls.ThreadlessExecutor
extends ConcurrentLinkedQueue<Runnable>
implements Executor
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprivate static voidrunQuietly(Runnable runnable) voidshutdown()Called after final call towaitAndDrain(), from same thread.private static voidvoidWaits until there is a Runnable, then executes it and all queued Runnables after it.Methods inherited from class ConcurrentLinkedQueue
add, addAll, contains, isEmpty, iterator, offer, peek, poll, remove, size, spliterator, toArray, toArrayMethods inherited from class AbstractQueue
clear, element, removeMethods inherited from class AbstractCollection
containsAll, removeAll, retainAll, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Collection
clear, containsAll, equals, hashCode, parallelStream, removeAll, removeIf, retainAll, stream
-
Field Details
-
log
-
SHUTDOWN
-
waiter
-
-
Constructor Details
-
ThreadlessExecutor
ThreadlessExecutor()
-
-
Method Details
-
waitAndDrain
Waits until there is a Runnable, then executes it and all queued Runnables after it. Must only be called by one thread at a time.- Throws:
InterruptedException
-
shutdown
public void shutdown()Called after final call towaitAndDrain(), from same thread. -
runQuietly
-
throwIfInterrupted
- Throws:
InterruptedException
-
execute
-