Package io.grpc.internal
Class SerializingExecutor
java.lang.Object
io.grpc.internal.SerializingExecutor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static final class
private static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final SerializingExecutor.AtomicHelper
private Executor
Underlying executor that all submitted Runnable objects are run on.private static final Logger
private static final int
A list of Runnables to be run in order.private int
private static final int
-
Constructor Summary
ConstructorsConstructorDescriptionSerializingExecutor
(Executor executor) Creates a SerializingExecutor, running tasks usingexecutor
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Runs the given runnable strictly after all Runnables that were submitted before it, and using theexecutor
passed to the constructor.private static SerializingExecutor.AtomicHelper
void
run()
private void
void
setExecutor
(Executor executor) Only call this from this SerializingExecutor Runnable, so that the executor is immediately visible to this SerializingExecutor executor.
-
Field Details
-
log
-
atomicHelper
-
STOPPED
private static final int STOPPED- See Also:
-
RUNNING
private static final int RUNNING- See Also:
-
executor
Underlying executor that all submitted Runnable objects are run on. -
runQueue
A list of Runnables to be run in order. -
runState
private volatile int runState
-
-
Constructor Details
-
SerializingExecutor
Creates a SerializingExecutor, running tasks usingexecutor
.- Parameters:
executor
- Executor in which tasks should be run. Must not be null.
-
-
Method Details
-
getAtomicHelper
-
setExecutor
Only call this from this SerializingExecutor Runnable, so that the executor is immediately visible to this SerializingExecutor executor. -
execute
Runs the given runnable strictly after all Runnables that were submitted before it, and using theexecutor
passed to the constructor. . -
schedule
-
run
public void run()
-