Class DurableTaskGrpcWorker

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public final class DurableTaskGrpcWorker
    extends java.lang.Object
    implements java.lang.AutoCloseable
    Task hub worker that connects to a sidecar process over gRPC to execute orchestrator and activity events.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes the internally managed gRPC channel, if one exists.
      void start()
      Establishes a gRPC connection to the sidecar and starts processing work-items in the background.
      void startAndBlock()
      Establishes a gRPC connection to the sidecar and starts processing work-items on the current thread.
      void stop()
      Stops the current worker's listen loop, preventing any new orchestrator or activity events from being processed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • start

        public void start()
        Establishes a gRPC connection to the sidecar and starts processing work-items in the background.

        This method retries continuously to establish a connection to the sidecar. If a connection fails, a warning log message will be written and a new connection attempt will be made. This process continues until either a connection succeeds or the process receives an interrupt signal.

      • close

        public void close()
        Closes the internally managed gRPC channel, if one exists.

        This method is a no-op if this client object was created using a builder with a gRPC channel object explicitly configured.

        Specified by:
        close in interface java.lang.AutoCloseable
      • startAndBlock

        public void startAndBlock()
        Establishes a gRPC connection to the sidecar and starts processing work-items on the current thread. This method call blocks indefinitely, or until the current thread is interrupted.

        Use can alternatively use the start() method to run orchestration processing in a background thread.

        This method retries continuously to establish a connection to the sidecar. If a connection fails, a warning log message will be written and a new connection attempt will be made. This process continues until either a connection succeeds or the process receives an interrupt signal.

      • stop

        public void stop()
        Stops the current worker's listen loop, preventing any new orchestrator or activity events from being processed.