Package io.grpc.internal
Class SerializeReentrantCallsDirectExecutor
- java.lang.Object
-
- io.grpc.internal.SerializeReentrantCallsDirectExecutor
-
- All Implemented Interfaces:
java.util.concurrent.Executor
class SerializeReentrantCallsDirectExecutor extends java.lang.Object implements java.util.concurrent.ExecutorExecutes a task directly in the calling thread, unless it's a reentrant call in which case the task is enqueued and executed once the calling task completes.The
Executorassumes that reentrant calls are rare and its fast path is thus optimized for that - avoiding queuing and additional object creation altogether.This class is not thread-safe.
-
-
Constructor Summary
Constructors Constructor Description SerializeReentrantCallsDirectExecutor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcompleteQueuedTasks()private voidenqueue(java.lang.Runnable r)voidexecute(java.lang.Runnable task)
-