Package org.eclipse.jetty.util.thread
Interface TryExecutor
-
- All Superinterfaces:
Executor
- All Known Implementing Classes:
ExecutorSizedThreadPool,ExecutorThreadPool,MonitoredQueuedThreadPool,QueuedThreadPool,ReservedThreadExecutor,TryExecutor.NoTryExecutor
public interface TryExecutor extends Executor
A variation of Executor that can confirm if a thread is available immediately
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classTryExecutor.NoTryExecutor
-
Field Summary
Fields Modifier and Type Field Description static TryExecutorNO_TRY
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static TryExecutorasTryExecutor(Executor executor)default voidexecute(Runnable task)booleantryExecute(Runnable task)Attempt to execute a task.
-
-
-
Field Detail
-
NO_TRY
static final TryExecutor NO_TRY
-
-
Method Detail
-
tryExecute
boolean tryExecute(Runnable task)
Attempt to execute a task.- Parameters:
task- The task to be executed- Returns:
- True IFF the task has been given directly to a thread to execute. The task cannot be queued pending the later availability of a Thread.
-
asTryExecutor
static TryExecutor asTryExecutor(Executor executor)
-
-