Class DurableTaskGrpcWorker
- java.lang.Object
-
- com.microsoft.durabletask.DurableTaskGrpcWorker
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public final class DurableTaskGrpcWorker extends java.lang.Object implements java.lang.AutoCloseableTask 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 voidclose()Closes the internally managed gRPC channel, if one exists.voidstart()Establishes a gRPC connection to the sidecar and starts processing work-items in the background.voidstartAndBlock()Establishes a gRPC connection to the sidecar and starts processing work-items on the current thread.voidstop()Stops the current worker's listen loop, preventing any new orchestrator or activity events from being processed.
-
-
-
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:
closein interfacejava.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.
-
-