public class SyncActivityWorker extends java.lang.Object implements SuspendableWorker
Constructor and Description |
---|
SyncActivityWorker(io.temporal.serviceclient.WorkflowServiceStubs service,
java.lang.String namespace,
java.lang.String taskQueue,
double taskQueueActivitiesPerSecond,
WorkerInterceptor[] workerInterceptors,
SingleWorkerOptions options) |
Modifier and Type | Method and Description |
---|---|
void |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit) |
boolean |
isShutdown() |
boolean |
isStarted() |
boolean |
isSuspended() |
boolean |
isTerminated() |
void |
registerActivityImplementations(java.lang.Object... activitiesImplementation) |
void |
resumePolling()
Allow new poll requests.
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
shutdown(ShutdownManager shutdownManager,
boolean interruptTasks) |
void |
start() |
void |
suspendPolling()
Do not make new poll requests.
|
java.lang.String |
toString() |
public SyncActivityWorker(io.temporal.serviceclient.WorkflowServiceStubs service, java.lang.String namespace, java.lang.String taskQueue, double taskQueueActivitiesPerSecond, WorkerInterceptor[] workerInterceptors, SingleWorkerOptions options)
public void registerActivityImplementations(java.lang.Object... activitiesImplementation)
public boolean isShutdown()
isShutdown
in interface Shutdownable
public boolean isTerminated()
isTerminated
in interface Shutdownable
public java.util.concurrent.CompletableFuture<java.lang.Void> shutdown(ShutdownManager shutdownManager, boolean interruptTasks)
shutdown
in interface Shutdownable
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 (like ExecutorService.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 completionCompletableFuture.exceptionally(Function)
as downstream dependencies have no use of this
information (they need to perform a shutdown anyway), and it complicates the shutdown flow.public void awaitTermination(long timeout, java.util.concurrent.TimeUnit unit)
awaitTermination
in interface Shutdownable
public void suspendPolling()
Suspendable
suspendPolling
in interface Suspendable
public void resumePolling()
Suspendable
resumePolling
in interface Suspendable
public boolean isSuspended()
isSuspended
in interface Suspendable
public java.lang.String toString()
toString
in class java.lang.Object