Class TemporalOperationResult<TResult>
- Namespace
- Temporalio.Nexus
- Assembly
- Temporalio.dll
Unified result type for Temporal-backed Nexus operations. Encapsulates either a synchronous result value or an asynchronous operation token.
public sealed class TemporalOperationResult<TResult>
Type Parameters
TResultThe result type.
- Inheritance
-
TemporalOperationResult<TResult>
- Inherited Members
Remarks
WARNING: Nexus support is experimental.
Use SyncResult(TResult?) for operations that complete immediately (e.g., signals). Use AsyncResult(string) for operations that return an operation token for async completion (e.g., starting a workflow).
Properties
IsSyncResult
Gets a value indicating whether this is a synchronous result.
public bool IsSyncResult { get; }
Property Value
Methods
AsyncResult(string)
Create an asynchronous result with the given operation token.
public static TemporalOperationResult<TResult> AsyncResult(string token)
Parameters
tokenstringThe operation token.
Returns
- TemporalOperationResult<TResult>
An asynchronous operation result.
Exceptions
- ArgumentException
If the token is null or empty.
SyncResult(TResult?)
Create a synchronous result with the given value.
public static TemporalOperationResult<TResult> SyncResult(TResult? value)
Parameters
valueTResultThe result value.
Returns
- TemporalOperationResult<TResult>
A synchronous operation result.