Package io.temporal.internal.worker
Class ShutdownManager
- java.lang.Object
-
- io.temporal.internal.worker.ShutdownManager
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class ShutdownManager extends java.lang.Object implements java.io.Closeable
-
-
Constructor Summary
Constructors Constructor Description ShutdownManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static long
awaitTermination(Shutdownable s, long timeoutMillis)
static long
awaitTermination(java.util.concurrent.ExecutorService s, long timeoutMillis)
void
close()
static long
runAndGetRemainingTimeoutMs(long initialTimeoutMs, java.lang.Runnable toRun)
java.util.concurrent.CompletableFuture<java.lang.Void>
shutdownExecutor(java.util.concurrent.ExecutorService executorToShutdown, java.lang.String executorName, java.time.Duration timeout)
executorToShutdown.shutdown() -> timed wait for graceful termination -> executorToShutdown.shutdownNow()java.util.concurrent.CompletableFuture<java.lang.Void>
shutdownExecutorNow(java.util.concurrent.ExecutorService executorToShutdown, java.lang.String executorName, java.time.Duration timeout)
executorToShutdown.shutdownNow() -> timed wait for a graceful terminationjava.util.concurrent.CompletableFuture<java.lang.Void>
shutdownExecutorNowUntimed(java.util.concurrent.ExecutorService executorToShutdown, java.lang.String executorName)
executorToShutdown.shutdownNow() -> unlimited wait for terminationjava.util.concurrent.CompletableFuture<java.lang.Void>
shutdownExecutorUntimed(java.util.concurrent.ExecutorService executorToShutdown, java.lang.String executorName)
executorToShutdown.shutdown() -> unlimited wait for graceful terminationjava.util.concurrent.CompletableFuture<java.lang.Void>
waitForSemaphorePermitsReleaseUntimed(java.util.concurrent.Semaphore semaphore, int initialSemaphorePermits, java.lang.String semaphoreName)
-
-
-
Method Detail
-
shutdownExecutorNow
public java.util.concurrent.CompletableFuture<java.lang.Void> shutdownExecutorNow(java.util.concurrent.ExecutorService executorToShutdown, java.lang.String executorName, java.time.Duration timeout)
executorToShutdown.shutdownNow() -> timed wait for a graceful termination
-
shutdownExecutorNowUntimed
public java.util.concurrent.CompletableFuture<java.lang.Void> shutdownExecutorNowUntimed(java.util.concurrent.ExecutorService executorToShutdown, java.lang.String executorName)
executorToShutdown.shutdownNow() -> unlimited wait for termination
-
shutdownExecutor
public java.util.concurrent.CompletableFuture<java.lang.Void> shutdownExecutor(java.util.concurrent.ExecutorService executorToShutdown, java.lang.String executorName, java.time.Duration timeout)
executorToShutdown.shutdown() -> timed wait for graceful termination -> executorToShutdown.shutdownNow()
-
shutdownExecutorUntimed
public java.util.concurrent.CompletableFuture<java.lang.Void> shutdownExecutorUntimed(java.util.concurrent.ExecutorService executorToShutdown, java.lang.String executorName)
executorToShutdown.shutdown() -> unlimited wait for graceful termination
-
waitForSemaphorePermitsReleaseUntimed
public java.util.concurrent.CompletableFuture<java.lang.Void> waitForSemaphorePermitsReleaseUntimed(java.util.concurrent.Semaphore semaphore, int initialSemaphorePermits, java.lang.String semaphoreName)
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
awaitTermination
public static long awaitTermination(@Nullable java.util.concurrent.ExecutorService s, long timeoutMillis)
-
runAndGetRemainingTimeoutMs
public static long runAndGetRemainingTimeoutMs(long initialTimeoutMs, java.lang.Runnable toRun)
-
awaitTermination
public static long awaitTermination(@Nullable Shutdownable s, long timeoutMillis)
-
-