Package io.grpc.internal
Class SerializingExecutor
java.lang.Object
io.grpc.internal.SerializingExecutor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static final classprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final SerializingExecutor.AtomicHelperprivate ExecutorUnderlying executor that all submitted Runnable objects are run on.private static final Loggerprivate static final intA list of Runnables to be run in order.private intprivate static final int -
Constructor Summary
ConstructorsConstructorDescriptionSerializingExecutor(Executor executor) Creates a SerializingExecutor, running tasks usingexecutor. -
Method Summary
Modifier and TypeMethodDescriptionvoidRuns the given runnable strictly after all Runnables that were submitted before it, and using theexecutorpassed to the constructor.private static SerializingExecutor.AtomicHelpervoidrun()private voidvoidsetExecutor(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 theexecutorpassed to the constructor. . -
schedule
-
run
public void run()
-