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 longawaitTermination(Shutdownable s, long timeoutMillis)static longawaitTermination(java.util.concurrent.ExecutorService s, long timeoutMillis)voidclose()static longrunAndGetRemainingTimeoutMs(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)java.util.concurrent.CompletableFuture<java.lang.Void>waitForStickyQueueBalancer(StickyQueueBalancer balancer, java.time.Duration timeout)waitForStickyQueueBalancer -> disableNormalPoll -> timed wait for graceful completion of sticky workflows
-
-
-
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)
-
waitForStickyQueueBalancer
public java.util.concurrent.CompletableFuture<java.lang.Void> waitForStickyQueueBalancer(StickyQueueBalancer balancer, java.time.Duration timeout)
waitForStickyQueueBalancer -> disableNormalPoll -> timed wait for graceful completion of sticky workflows
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein 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)
-
-