Package io.temporal.internal.worker
Interface Shutdownable
-
- All Known Subinterfaces:
Lifecycle
,ShutdownableTaskExecutor<T>
,SuspendableWorker
- All Known Implementing Classes:
ActivityWorker
,LocalActivityWorker
,Poller
,PollWorkflowTaskDispatcher
,SyncActivityWorker
,SyncWorkflowWorker
,WorkflowWorker
public interface Shutdownable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
awaitTermination(long timeout, java.util.concurrent.TimeUnit unit)
boolean
isShutdown()
boolean
isTerminated()
java.util.concurrent.CompletableFuture<java.lang.Void>
shutdown(ShutdownManager shutdownManager, boolean interruptTasks)
-
-
-
Method Detail
-
isShutdown
boolean isShutdown()
-
isTerminated
boolean isTerminated()
-
shutdown
java.util.concurrent.CompletableFuture<java.lang.Void> shutdown(ShutdownManager shutdownManager, boolean interruptTasks)
- Parameters:
shutdownManager
- provides toolset to get a Future for a shutdown of instances that have both non-blocking and not returning a Future on a completion shutdown methods (likeExecutorService.shutdown()
)interruptTasks
- if the threads processing user code (like workflows, workflow tasks or activities) should be interrupted, or we want to wait for their full graceful completion- Returns:
- CompletableFuture which should be completed when awaiting downstream dependencies can
proceed with their own shutdown. Should never be completed exceptionally
CompletableFuture.exceptionally(Function)
as downstream dependencies have no use of this information (they need to perform a shutdown anyway), and it complicates the shutdown flow.
-
awaitTermination
void awaitTermination(long timeout, java.util.concurrent.TimeUnit unit)
-
-