Skip to content

Commit 3531c77

Browse files
committed
Update docs
1 parent cee5e8f commit 3531c77

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

docs/features/child-workflows.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ class ParentWorkflow extends Workflow
2323

2424
## Signaling Child Workflows
2525

26-
Parent workflows can signal their child workflows to coordinate behavior or pass data. To signal a child safely without corrupting the parent's execution context, use the `child()` or `children()` methods.
26+
Parent workflows can signal their child workflows to coordinate behavior or pass data. To signal a child safely without corrupting the parent's execution context, use the `$this->child()` or `$this->children()` methods.
2727

2828
### Getting a Child Handle
2929

30-
The `child()` method returns a `ChildWorkflowHandle` for the most recently created child workflow:
30+
The `$this->child()` method returns a `ChildWorkflowHandle` for the most recently created child workflow:
3131

3232
```php
3333
use function Workflow\child;
@@ -52,7 +52,7 @@ class ParentWorkflow extends Workflow
5252

5353
### Multiple Children
5454

55-
Use the `children()` method to get handles for all child workflows created by the parent:
55+
Use the `$this->children()` method to get handles for all child workflows created by the parent:
5656

5757
```php
5858
use function Workflow\{all, child};
@@ -79,7 +79,7 @@ class ParentWorkflow extends Workflow
7979
}
8080
```
8181

82-
The `children()` method returns children in reverse chronological order (most recently created first).
82+
The `$this->children()` method returns children in reverse chronological order (most recently created first).
8383

8484
### Forwarding Signals to Children
8585

@@ -123,7 +123,7 @@ class ParentWorkflow extends Workflow
123123

124124
### Getting Child Workflow IDs
125125

126-
You can access the underlying stored workflow ID using the `id()` method. This allows you to store the ID for external systems to signal the child directly.
126+
You can access the underlying stored workflow ID using the `id()` method on the child handle. This allows you to store the ID for external systems to signal the child directly.
127127

128128
```php
129129
use function Workflow\{activity, child};

docs/features/timers.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,21 @@ $start = yield sideEffect(fn () => WorkflowStub::now());
4040
```
4141

4242
This ensures an event log is created, preventing replay-related inconsistencies and guaranteeing accurate time calculations.
43+
44+
## Time Helpers
45+
46+
You can also use the following helper functions to create timers for specific units of time:
47+
48+
- `seconds($value)`
49+
- `minutes($value)`
50+
- `hours($value)`
51+
- `days($value)`
52+
- `weeks($value)`
53+
- `months($value)`
54+
- `years($value)`
55+
56+
```php
57+
use function Workflow\minutes;
58+
59+
yield minutes(5);
60+
```

0 commit comments

Comments
 (0)