Skip to content

Commit b753d2c

Browse files
committed
Fix README and comments in Nexus Messaging samples
1 parent 959678c commit b753d2c

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

‎core/src/main/java/io/temporal/samples/nexusmessaging/callerpattern/README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
## Caller pattern
22

33
The handler worker starts a `GreetingWorkflow` for a User ID.
4-
`NexusGreetingServiceImpl` holds that ID and routes every Nexus operation to it.
4+
`NexusGreetingServiceImpl` derives the Workflow ID and routes every Nexus operation to it.
55
The caller's input does not have that Workflow ID as the caller doesn't know it - but the caller sends in the User ID,
6-
and `NexusGreetingServiceImpl` knows how to get the desired Workflow ID from that User ID (see the getWorkflowId call).
6+
and `NexusGreetingServiceImpl` knows how to get the desired Workflow ID from that User ID (see the `getWorkflowId` call).
77

8-
HandlerWorker is using the same getWorkflowId call to generate a Workflow ID from a User ID when it launches the Workflow.
8+
`HandlerWorker` is using the same `getWorkflowId` call to generate a Workflow ID from a User ID when it launches the Workflow.
99

1010
The caller Workflow:
1111
1. Queries for supported languages (`getLanguages` — backed by a `@QueryMethod`)

‎core/src/main/java/io/temporal/samples/nexusmessaging/ondemandpattern/handler/NexusRemoteGreetingServiceImpl.java‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
import org.slf4j.LoggerFactory;
1414

1515
/**
16-
* Nexus operation handler for the on-demand pattern. Each operation receives the target workflow ID
17-
* in its input, and {@code runFromRemote} starts a brand-new GreetingWorkflow.
16+
* Nexus operation handler for the on-demand pattern. Each operation receives a userId, which is
17+
* mapped to a workflow ID using {@link #WORKFLOW_ID_PREFIX}, and {@code runFromRemote} starts a
18+
* brand-new GreetingWorkflow.
1819
*/
1920
@ServiceImpl(service = NexusRemoteGreetingService.class)
2021
public class NexusRemoteGreetingServiceImpl {
@@ -38,8 +39,8 @@ private GreetingWorkflow getWorkflowStub(String userId) {
3839
.newWorkflowStub(GreetingWorkflow.class, getWorkflowId(userId));
3940
}
4041

41-
// Starts a new GreetingWorkflow with the caller-specified workflow ID. This is an async
42-
// Nexus operation backed by WorkflowRunOperation.
42+
// Starts a new GreetingWorkflow, using a workflow ID derived from the caller-supplied userId.
43+
// This is an async Nexus operation backed by WorkflowRunOperation.
4344
@OperationImpl
4445
public OperationHandler<NexusRemoteGreetingService.RunFromRemoteInput, String> runFromRemote() {
4546
return WorkflowRunOperation.fromWorkflowHandle(

‎core/src/main/java/io/temporal/samples/nexusmessagingtemporaloperation/README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
This sample shows how to expose a long-running Workflow's queries, updates, and signals as Nexus operations. This
22
version uses the experimental `@TemporalOperation` annotation to declare Temporal-backed Nexus operations as ordinary
3-
methods on `@ServiceImpl` classes instead of `@OperationImpl` factories that return `TemporalOperationHandler.create(...)`.
3+
methods on `@ServiceImpl` classes instead of `@OperationImpl` factories that return `OperationHandler.sync(...)` and
4+
`WorkflowRunOperation.fromWorkflowHandle(...)`.
45

56
There are two self-contained examples, each in its own directory:
67

0 commit comments

Comments
 (0)