Share via


DurableTaskGrpcWorker Class

  • java.lang.Object
    • com.microsoft.durabletask.DurableTaskGrpcWorker

Implements

java.lang.AutoCloseable

public final class DurableTaskGrpcWorker
implements java.lang.AutoCloseable

Task hub worker that connects to a sidecar process over gRPC to execute orchestrator and activity events.

Method Summary

Modifier and Type Method and 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 java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Method Details

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.

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.

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.

Applies to