Skip to content

Commit 6bbb997

Browse files
authored
Add doc on start child async (#487)
1 parent 8cdc26b commit 6bbb997

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/main/java/com/uber/cadence/workflow/Workflow.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,27 @@
290290
* }
291291
* </code></pre>
292292
*
293+
* To start child then return and let child run:
294+
*
295+
* <pre><code>
296+
* public static class GreetingWorkflowImpl implements GreetingWorkflow {
297+
*
298+
* {@literal @}Override
299+
* public String getGreeting(String name) {
300+
*
301+
* GreetingChild child1 = Workflow.newChildWorkflowStub(GreetingChild.class);
302+
* Async.function(child1::composeGreeting, "Hello", name);
303+
*
304+
* // block until child started,
305+
* // otherwise child may not start because parent complete first.
306+
* Promise<WorkflowExecution> childPromise = Workflow.getWorkflowExecution(child);
307+
* childPromise.get();
308+
*
309+
* return "Parent Greeting";
310+
* }
311+
* }
312+
* </code></pre>
313+
*
293314
* To send signal to a child, call a method annotated with {@literal @}{@link SignalMethod}:
294315
*
295316
* <pre><code>

0 commit comments

Comments
 (0)