Share via


DurableTaskGrpcWorkerBuilder Class

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

public final class DurableTaskGrpcWorkerBuilder

Builder object for constructing customized DurableTaskGrpcWorker instances.

Constructor Summary

Constructor Description
DurableTaskGrpcWorkerBuilder()

Method Summary

Modifier and Type Method and Description
DurableTaskGrpcWorkerBuilder addActivity(TaskActivityFactory factory)

Adds an activity factory to be used by the constructed DurableTaskGrpcWorker.

DurableTaskGrpcWorkerBuilder addOrchestration(TaskOrchestrationFactory factory)

Adds an orchestration factory to be used by the constructed DurableTaskGrpcWorker.

DurableTaskGrpcWorker build()

Initializes a new DurableTaskGrpcWorker object with the settings specified in the current builder object.

DurableTaskGrpcWorkerBuilder dataConverter(DataConverter dataConverter)

Sets the DataConverter to use for converting serializable data payloads.

DurableTaskGrpcWorkerBuilder grpcChannel(Channel channel)

Sets the gRPC channel to use for communicating with the sidecar process.

DurableTaskGrpcWorkerBuilder port(int port)

Sets the gRPC endpoint port to connect to.

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

Constructor Details

DurableTaskGrpcWorkerBuilder

public DurableTaskGrpcWorkerBuilder()

Method Details

addActivity

public DurableTaskGrpcWorkerBuilder addActivity(TaskActivityFactory factory)

Adds an activity factory to be used by the constructed DurableTaskGrpcWorker.

Parameters:

factory - an activity factory to be used by the constructed DurableTaskGrpcWorker

Returns:

this builder object

addOrchestration

public DurableTaskGrpcWorkerBuilder addOrchestration(TaskOrchestrationFactory factory)

Adds an orchestration factory to be used by the constructed DurableTaskGrpcWorker.

Parameters:

factory - an orchestration factory to be used by the constructed DurableTaskGrpcWorker

Returns:

this builder object

build

public DurableTaskGrpcWorker build()

Initializes a new DurableTaskGrpcWorker object with the settings specified in the current builder object.

Returns:

dataConverter

public DurableTaskGrpcWorkerBuilder dataConverter(DataConverter dataConverter)

Sets the DataConverter to use for converting serializable data payloads.

Parameters:

dataConverter - the DataConverter to use for converting serializable data payloads

Returns:

this builder object

grpcChannel

public DurableTaskGrpcWorkerBuilder grpcChannel(Channel channel)

Sets the gRPC channel to use for communicating with the sidecar process.

This builder method allows you to provide your own gRPC channel for communicating with the Durable Task sidecar endpoint. Channels provided using this method won't be closed when the worker is closed. Rather, the caller remains responsible for shutting down the channel after disposing the worker.

If not specified, a gRPC channel will be created automatically for each constructed DurableTaskGrpcWorker.

Parameters:

channel - the gRPC channel to use

Returns:

this builder object

port

public DurableTaskGrpcWorkerBuilder port(int port)

Sets the gRPC endpoint port to connect to. If not specified, the default Durable Task port number will be used.

Parameters:

port - the gRPC endpoint port to connect to

Returns:

this builder object

Applies to