Package com.linecorp.armeria.common.util
Interface BlockingTaskExecutor
- All Superinterfaces:
AutoCloseable
,Executor
,ExecutorService
,ScheduledExecutorService
- All Known Subinterfaces:
ContextAwareBlockingTaskExecutor
Provides an executor interface which is used for potentially long-running tasks which may block I/O threads.
-
Method Summary
Modifier and TypeMethodDescriptionstatic BlockingTaskExecutorBuilder
builder()
Returns a new builder forBlockingTaskExecutor
.static BlockingTaskExecutor
of()
Returns the defaultBlockingTaskExecutor
with a 60s timeout and unbounded work queue.static BlockingTaskExecutor
of
(ScheduledExecutorService executor) Returns a newBlockingTaskExecutor
that uses the specifiedScheduledExecutorService
to schedule and submit tasks.default ScheduledExecutorService
unwrap()
Unwraps thisBlockingTaskExecutor
and returns theScheduledExecutorService
being decorated.Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, close, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit
Methods inherited from interface java.util.concurrent.ScheduledExecutorService
schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay
-
Method Details
-
of
Returns the defaultBlockingTaskExecutor
with a 60s timeout and unbounded work queue. Note that this method returns the same instance with whatCommonPools.blockingTaskExecutor()
returns. -
of
Returns a newBlockingTaskExecutor
that uses the specifiedScheduledExecutorService
to schedule and submit tasks. -
builder
Returns a new builder forBlockingTaskExecutor
. -
unwrap
Unwraps thisBlockingTaskExecutor
and returns theScheduledExecutorService
being decorated.
-