Package com.intellij.util.concurrency
Class AppScheduledExecutorService
java.lang.Object
com.intellij.util.concurrency.AppScheduledExecutorService
- All Implemented Interfaces:
AutoCloseable,Executor,ExecutorService,ScheduledExecutorService
A ThreadPoolExecutor which also implements
ScheduledExecutorService by awaiting scheduled tasks in a separate thread
and then executing them in the owned ThreadPoolExecutor.
Unlike the existing ScheduledThreadPoolExecutor, this pool is unbounded.-
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long timeout, TimeUnit unit) voidintinvokeAll(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) booleanboolean<V> ScheduledFuture<V> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) voidsetNewThreadListener(Consumer<Thread> threadListener) voidshutdown()voidFuture<?> <T> Future<T> <T> Future<T> Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.ExecutorService
close
-
Method Details
-
setNewThreadListener
-
shutdownNow
- Specified by:
shutdownNowin interfaceExecutorService
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceExecutorService
-
shutdownAppScheduledExecutorService
public void shutdownAppScheduledExecutorService() -
statistics
-
getBackendPoolExecutorSize
public int getBackendPoolExecutorSize() -
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceExecutorService
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceExecutorService
-
awaitTermination
- Specified by:
awaitTerminationin interfaceExecutorService- Throws:
InterruptedException
-
schedule
@NotNull public ScheduledFuture<?> schedule(@NotNull Runnable command, long delay, @NotNull TimeUnit unit) - Specified by:
schedulein interfaceScheduledExecutorService
-
schedule
@NotNull public <V> ScheduledFuture<V> schedule(@NotNull Callable<V> callable, long delay, @NotNull TimeUnit unit) - Specified by:
schedulein interfaceScheduledExecutorService
-
scheduleAtFixedRate
@NotNull public ScheduledFuture<?> scheduleAtFixedRate(@NotNull Runnable command, long initialDelay, long period, @NotNull TimeUnit unit) - Specified by:
scheduleAtFixedRatein interfaceScheduledExecutorService
-
scheduleWithFixedDelay
@NotNull public ScheduledFuture<?> scheduleWithFixedDelay(@NotNull Runnable command, long initialDelay, long delay, @NotNull TimeUnit unit) - Specified by:
scheduleWithFixedDelayin interfaceScheduledExecutorService
-
submit
- Specified by:
submitin interfaceExecutorService
-
submit
- Specified by:
submitin interfaceExecutorService
-
submit
- Specified by:
submitin interfaceExecutorService
-
invokeAll
@NotNull public <T> List<Future<T>> invokeAll(@NotNull Collection<? extends Callable<T>> tasks) throws InterruptedException - Specified by:
invokeAllin interfaceExecutorService- Throws:
InterruptedException
-
invokeAll
@NotNull public <T> List<Future<T>> invokeAll(@NotNull Collection<? extends Callable<T>> tasks, long timeout, @NotNull TimeUnit unit) throws InterruptedException - Specified by:
invokeAllin interfaceExecutorService- Throws:
InterruptedException
-
invokeAny
@NotNull public <T> T invokeAny(@NotNull Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException - Specified by:
invokeAnyin interfaceExecutorService- Throws:
InterruptedExceptionExecutionException
-
invokeAny
public <T> T invokeAny(@NotNull Collection<? extends Callable<T>> tasks, long timeout, @NotNull TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
invokeAnyin interfaceExecutorService- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
execute
-