/// <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.ResolveNamespace(Options?.Namespace)); }
/// <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.Clear; if (parentWorkflow != null) { var stub = parentWorkflow.NewLocalActivityStub <ILocalOperations, LocalOperations>(); await stub.GetResultAsync(Execution); } else { await client.GetWorkflowResultAsync(Execution, @namespace); } }
/// <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, @namespace); }