Class DurableTaskGrpcWorker

java.lang.Object
io.dapr.durabletask.DurableTaskGrpcWorker
All Implemented Interfaces:
AutoCloseable

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

    Modifier and Type
    Method
    Description
    void
    Closes the internally managed gRPC channel and executor service, if one exists.
    void
    Establishes a gRPC connection to the sidecar and starts processing work-items in the background.
    void
    Establishes a gRPC connection to the sidecar and starts processing work-items on the current thread.
    void
    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 Details

    • 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 and executor service, if one exists.

      Only the internally managed GRPC Channel and Executor services are closed. If any of them are supplied, it is the responsibility of the supplier to take care of them.

      Specified by:
      close in interface 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.