Conversation
| } | ||
|
|
||
| [WorkflowSignal] | ||
| public async Task ApproveAsync(string name) |
There was a problem hiding this comment.
Either should should return void (not sure if that's allowed for signal handlers) or the method should return Task.CompletedTask.
| ## Entity pattern | ||
|
|
||
| The handler worker starts a `GreetingWorkflow` for a user ID at boot time. | ||
| `NexusGreetingService` routes every Nexus operation to that existing workflow by deriving |
There was a problem hiding this comment.
I noticed recently that we usually capitalized Workflow in docs. I think all Temporal primitives are title cased. Maybe we should do the same here to be consistent.
| } | ||
| catch (Temporalio.Exceptions.RpcException ex) | ||
| { | ||
| logger.LogWarning(ex, "Could not start entity workflow, may already exist"); |
There was a problem hiding this comment.
| logger.LogWarning(ex, "Could not start entity workflow, may already exist"); | |
| logger.LogWarning(ex, "Could not start entity workflow"); |
If the workflow already exists, it should attach to the currently running workflow due to IdConflictPolicy = Temporalio.Api.Enums.V1.WorkflowIdConflictPolicy.UseExisting, correct?
| implementation. This highlights that the same activity logic can be exposed through Nexus in different | ||
| ways depending on whether the caller needs lifecycle control. | ||
|
|
||
| See each directory's README for running instructions. |
There was a problem hiding this comment.
Could we link to those READMEs from here?
| { | ||
| } | ||
|
|
||
| public Task<string> EnsureHandlerTaskQueueAsync() => |
There was a problem hiding this comment.
Why is this using a lazy initializer? What problem is it trying to solve that just running the lamba body directly doesn't consider?
| @@ -0,0 +1,16 @@ | |||
| This sample shows how to expose a long-running workflow's queries, updates, and signals as Nexus | |||
There was a problem hiding this comment.
Let's include this in the README at https://github.com/temporalio/samples-dotnet/blob/main/README.md
| (CallerRemoteWorkflow wf) => wf.RunAsync(), | ||
| new(id: $"wf-{Guid.NewGuid()}", taskQueue: callerWorker.Options.TaskQueue!)); | ||
|
|
||
| Assert.True(result.Length > 0); |
There was a problem hiding this comment.
Let's assert the exact expected length and that each line in the result has the expected containment.
This is sample code to show two ways to send messages (signals, queries, and updates) through Nexus.