Class SyncNexusWorker

java.lang.Object
io.temporal.internal.worker.SyncNexusWorker
All Implemented Interfaces:
Shutdownable, Startable, Suspendable, SuspendableWorker, WorkerWithLifecycle

public class SyncNexusWorker extends Object implements SuspendableWorker
  • Constructor Details

  • Method Details

    • shutdown

      public CompletableFuture<Void> shutdown(ShutdownManager shutdownManager, boolean interruptTasks)
      Specified by:
      shutdown in interface Shutdownable
      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 (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 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

      public void awaitTermination(long timeout, TimeUnit unit)
      Specified by:
      awaitTermination in interface Shutdownable
    • start

      public boolean start()
      Description copied from interface: Startable
      This method is not required to be idempotent. It is expected to be called only once.
      Specified by:
      start in interface Startable
      Returns:
      true if the start was successful, false if the worker configuration renders the start obsolete (like no types are registered)
    • suspendPolling

      public void suspendPolling()
      Description copied from interface: Suspendable
      Do not make new poll requests. Outstanding long polls still can return tasks after this method was called.
      Specified by:
      suspendPolling in interface Suspendable
    • resumePolling

      public void resumePolling()
      Description copied from interface: Suspendable
      Allow new poll requests.
      Specified by:
      resumePolling in interface Suspendable
    • isSuspended

      public boolean isSuspended()
      Specified by:
      isSuspended in interface Suspendable
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface Shutdownable
    • isTerminated

      public boolean isTerminated()
      Specified by:
      isTerminated in interface Shutdownable
    • getSlotSupplier

      public TrackingSlotSupplier<NexusSlotInfo> getSlotSupplier()
    • getTaskCounter

      public TaskCounter getTaskCounter()
    • getPollerOptions

      public PollerOptions getPollerOptions()
    • getPollerTracker

      public PollerTracker getPollerTracker()
    • getLifecycleState

      public WorkerLifecycleState getLifecycleState()
      Specified by:
      getLifecycleState in interface WorkerWithLifecycle
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isAnyTypeSupported

      public boolean isAnyTypeSupported()
    • registerNexusServiceImplementation

      public void registerNexusServiceImplementation(Object... nexusServiceImplementations)