Table of Contents

Class CompletionCallbackCollection<TOutput>.Builder

Namespace
Temporalio.Nexus
Assembly
Temporalio.dll

Builder for an immutable callback collection. This builder is not thread safe.

public sealed class CompletionCallbackCollection<TOutput>.Builder : IEnumerable<CompletionCallback>, IEnumerable
Inheritance
CompletionCallbackCollection<TOutput>.Builder
Implements
Inherited Members

Constructors

Builder()

Initializes a new instance of the CompletionCallbackCollection<TOutput>.Builder class.

public Builder()

Methods

Add(string, string, string, object?)

Creates and adds a callback from service and operation names.

public CompletionCallbackCollection<TOutput>.Builder Add(string service, string operation, string taskQueue, object? sourceContext)

Parameters

service string

The name of the callback service.

operation string

The name of the callback operation.

taskQueue string

The task queue that runs the callback operation.

sourceContext object

The source context that the callback operation receives.

Returns

CompletionCallbackCollection<TOutput>.Builder

This builder.

Add(CompletionCallback<RawValue>)

Adds a callback that accepts raw payloads.

public CompletionCallbackCollection<TOutput>.Builder Add(CompletionCallback<RawValue> callback)

Parameters

callback CompletionCallback<RawValue>

The callback to add.

Returns

CompletionCallbackCollection<TOutput>.Builder

This builder.

Add(CompletionCallback<TOutput>)

Adds a callback that accepts the source operation's result type.

public CompletionCallbackCollection<TOutput>.Builder Add(CompletionCallback<TOutput> callback)

Parameters

callback CompletionCallback<TOutput>

The callback to add.

Returns

CompletionCallbackCollection<TOutput>.Builder

This builder.

Add<TService, TSourceContext>(Expression<Func<TService, OnCompleteRequest<RawValue, TSourceContext>, OnCompleteResponse>>, string, TSourceContext)

Creates and adds a callback that accepts raw payloads.

public CompletionCallbackCollection<TOutput>.Builder Add<TService, TSourceContext>(Expression<Func<TService, OnCompleteRequest<RawValue, TSourceContext>, OnCompleteResponse>> operationCall, string taskQueue, TSourceContext sourceContext)

Parameters

operationCall Expression<Func<TService, OnCompleteRequest<RawValue, TSourceContext>, OnCompleteResponse>>

An expression that selects the callback operation without calling it.

taskQueue string

The task queue that runs the callback operation.

sourceContext TSourceContext

The source context that the callback operation receives.

Returns

CompletionCallbackCollection<TOutput>.Builder

This builder.

Type Parameters

TService

The callback service interface.

TSourceContext

The type of the source context.

Add<TService, TSourceContext>(Expression<Func<TService, OnCompleteRequest<TOutput, TSourceContext>, OnCompleteResponse>>, string, TSourceContext)

Creates and adds a callback that accepts the source operation's result type.

public CompletionCallbackCollection<TOutput>.Builder Add<TService, TSourceContext>(Expression<Func<TService, OnCompleteRequest<TOutput, TSourceContext>, OnCompleteResponse>> operationCall, string taskQueue, TSourceContext sourceContext)

Parameters

operationCall Expression<Func<TService, OnCompleteRequest<TOutput, TSourceContext>, OnCompleteResponse>>

An expression that selects the callback operation without calling it.

taskQueue string

The task queue that runs the callback operation.

sourceContext TSourceContext

The source context that the callback operation receives.

Returns

CompletionCallbackCollection<TOutput>.Builder

This builder.

Type Parameters

TService

The callback service interface.

TSourceContext

The type of the source context.

Build()

Creates an immutable snapshot of this builder's callbacks.

public CompletionCallbackCollection<TOutput> Build()

Returns

CompletionCallbackCollection<TOutput>

A collection that is not affected by subsequent changes to this builder.

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<CompletionCallback> GetEnumerator()

Returns

IEnumerator<CompletionCallback>

An enumerator that can be used to iterate through the collection.