Package org.apache.pekko.dispatch
Class VirtualizedExecutorService
java.lang.Object
org.apache.pekko.dispatch.VirtualizedExecutorService
- All Implemented Interfaces:
Executor,ExecutorService,LoadMetrics
public final class VirtualizedExecutorService
extends Object
implements ExecutorService, LoadMetrics
A virtualized executor service that creates a new virtual thread for each task.
Will shut down the underlying executor service when this executor is being shutdown.
INTERNAL API
-
Constructor Summary
ConstructorsConstructorDescriptionVirtualizedExecutorService(ThreadFactory vtFactory, ExecutorService underlying, scala.Function1<Executor, Object> loadMetricsProvider, boolean cascadeShutdown) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanawaitTermination(long timeout, TimeUnit unit) voidinvokeAll(Collection<? extends Callable<T>> tasks) invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) <T> TinvokeAny(Collection<? extends Callable<T>> tasks) <T> TinvokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) booleanbooleanvoidshutdown()Future<?><T> Future<T><T> Future<T>
-
Constructor Details
-
VirtualizedExecutorService
public VirtualizedExecutorService(ThreadFactory vtFactory, ExecutorService underlying, scala.Function1<Executor, Object> loadMetricsProvider, boolean cascadeShutdown)
-
-
Method Details
-
atFullThrottle
public boolean atFullThrottle()- Specified by:
atFullThrottlein interfaceLoadMetrics
-
awaitTermination
- Specified by:
awaitTerminationin interfaceExecutorService
-
execute
-
invokeAll
- Specified by:
invokeAllin interfaceExecutorService
-
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) - Specified by:
invokeAllin interfaceExecutorService
-
invokeAny
- Specified by:
invokeAnyin interfaceExecutorService
-
invokeAny
- Specified by:
invokeAnyin interfaceExecutorService
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceExecutorService
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceExecutorService
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceExecutorService
-
shutdownNow
- Specified by:
shutdownNowin interfaceExecutorService
-
submit
- Specified by:
submitin interfaceExecutorService
-
submit
- Specified by:
submitin interfaceExecutorService
-
submit
- Specified by:
submitin interfaceExecutorService
-