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
servicestringThe name of the callback service.
operationstringThe name of the callback operation.
taskQueuestringThe task queue that runs the callback operation.
sourceContextobjectThe 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
callbackCompletionCallback<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
callbackCompletionCallback<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
operationCallExpression<Func<TService, OnCompleteRequest<RawValue, TSourceContext>, OnCompleteResponse>>An expression that selects the callback operation without calling it.
taskQueuestringThe task queue that runs the callback operation.
sourceContextTSourceContextThe source context that the callback operation receives.
Returns
- CompletionCallbackCollection<TOutput>.Builder
This builder.
Type Parameters
TServiceThe callback service interface.
TSourceContextThe 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
operationCallExpression<Func<TService, OnCompleteRequest<TOutput, TSourceContext>, OnCompleteResponse>>An expression that selects the callback operation without calling it.
taskQueuestringThe task queue that runs the callback operation.
sourceContextTSourceContextThe source context that the callback operation receives.
Returns
- CompletionCallbackCollection<TOutput>.Builder
This builder.
Type Parameters
TServiceThe callback service interface.
TSourceContextThe 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.