/// <summary> /// Waits for the workflow to complete or throws an error exception. Use this for /// workflows that don't return a result. /// </summary> /// <returns>The tracking <see cref="Task"/>.</returns> public async Task GetResultAsync() { await SyncContext.Clear; EnsureStarted(); if (Execution == null) { throw new InvalidOperationException("The stub can't obtain the workflow result because it doesn't have the workflow execution."); } await client.GetWorkflowResultAsync(Execution, client.ResolveDomain(Options?.Domain)); }
/// <summary> /// Attempts to retrieve the associated workflow result. /// </summary> /// <typeparam name="TResult">The result type.</typeparam> /// <returns>The result.</returns> public async Task <TResult> GetResultAsync <TResult>() { await SyncContext.ClearAsync; EnsureStarted(); if (Execution == null) { throw new InvalidOperationException("The stub can't obtain the workflow result because it doesn't have the workflow execution."); } return(client.DataConverter.FromData <TResult>(await client.GetWorkflowResultAsync(Execution, client.ResolveDomain(Options?.Domain)))); }
/// <summary> /// Waits for the workflow complete if necessary, without returning the result. /// </summary> /// <returns>The tracking <see cref="Task"/>.</returns> public async Task GetResultAsync() { await SyncContext.ClearAsync; if (parentWorkflow != null) { var stub = parentWorkflow.NewLocalActivityStub <ILocalOperations, LocalOperations>(); await stub.GetResultAsync(Execution); } else { await client.GetWorkflowResultAsync(Execution, domain); } }
/// <summary> /// Waits for the workflow to complete. /// </summary> /// <returns>The tracking <see cref="Task"/>.</returns> public async Task GetAsync() { await SyncContext.Clear; if (completed) { throw new InvalidOperationException($"[{nameof(IAsyncFuture<object>)}.GetAsync()] may only be called once per stub instance."); } completed = true; await client.GetWorkflowResultAsync(Execution, domain); }
/// <inheritdoc/> public async Task <TResult> GetResultAsync <TResult>() { EnsureStarted(); return(client.DataConverter.FromData <TResult>(await client.GetWorkflowResultAsync(Execution, domain))); }