Package io.grpc.stub
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 TypeMethodDescriptionvoid
private static void
runQuietly
(Runnable runnable) void
shutdown()
Called after final call towaitAndDrain()
, from same thread.private static void
void
Waits until there is a Runnable, then executes it and all queued Runnables after it.Methods inherited from class java.util.concurrent.ConcurrentLinkedQueue
add, addAll, contains, isEmpty, iterator, offer, peek, poll, remove, size, spliterator, toArray, toArray
Methods inherited from class java.util.AbstractQueue
clear, element, remove
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.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
-