Skip to content

Commit 6fbc007

Browse files
leandrodamascenayaythomas
authored andcommitted
docs: fix parallel description
1 parent a52ab08 commit 6fbc007

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

docs/core/child-contexts.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,9 @@ def handler(event: dict, context: DurableContext) -> dict:
453453
return result
454454
```
455455

456-
### Parallel child contexts
456+
### Sequential child contexts
457457

458-
Execute multiple child contexts in parallel:
458+
Execute multiple child contexts sequentially:
459459

460460
```python
461461
@durable_with_child_context
@@ -478,10 +478,10 @@ def process_region_c(ctx: DurableContext, data: dict) -> dict:
478478

479479
@durable_execution
480480
def handler(event: dict, context: DurableContext) -> dict:
481-
"""Process data for multiple regions in parallel."""
481+
"""Process data for multiple regions sequentially."""
482482
data = event["data"]
483483

484-
# Execute child contexts in parallel
484+
# Execute child contexts sequentially
485485
result_a = context.run_in_child_context(
486486
process_region_a(data),
487487
name="region_a"
@@ -503,6 +503,8 @@ def handler(event: dict, context: DurableContext) -> dict:
503503
}
504504
```
505505

506+
For parallel execution, use `context.parallel()` instead. See [Parallel operations](parallel.md) for details.
507+
506508
[↑ Back to top](#table-of-contents)
507509

508510
## Best practices
@@ -557,7 +559,7 @@ A: If an operation within a child context raises an exception, the exception pro
557559

558560
**Q: Can I create multiple child contexts in one function?**
559561

560-
A: Yes, you can create as many child contexts as needed. They execute sequentially unless you use parallel patterns.
562+
A: Yes, you can create as many child contexts as needed. They execute sequentially by default. For parallel execution, use `context.parallel()` instead.
561563

562564
**Q: Can I use callbacks in child contexts?**
563565

0 commit comments

Comments
 (0)