Skip to content

Commit d1d640d

Browse files
committed
Clarified documentation of replace policy for min_spacing
1 parent 3088664 commit d1d640d

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

docs/writing-reactors/actions.mdx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ An action declaration has one of the following forms:
2020
physical action <name>(<min_delay>, <min_spacing>, <policy>)
2121
```
2222

23-
The `min_delay`, `min_spacing`, and `policy` are all optional. If only one argument is given in parentheses, then it is interpreted as an `min_delay`, if two are given, then they are interpreted as `min_delay` and `min_spacing`. The `min_delay` and `min_spacing` are time values. The `policy` argument is a string that can be one of the following: `"defer"` (the default), `"drop"`, or `"replace"`. Note that the quotation marks are needed.
23+
The `min_delay`, `min_spacing`, and `policy` are all optional.
24+
If only one argument is given in parentheses, then it is interpreted as an `min_delay`,
25+
if two are given, then they are interpreted as `min_delay` and `min_spacing`.
26+
The `min_delay` and `min_spacing` are time values.
27+
The `policy` argument is a string that can be one of the following:
28+
`"defer"` (the default), `"drop"`, or `"replace"`. Note that the quotation marks are needed.
2429

2530
<ShowOnly c cpp ts rs>
2631

@@ -171,6 +176,14 @@ interval between the tags of two subsequently scheduled events. If the
171176
preliminary time is closer than `<min_spacing>` to the time of the previously
172177
scheduled event (if there is one), then `<policy>` (if supported by the target)
173178
determines how the minimum spacing constraint is enforced.
179+
Note that "previously scheduled" here means specifically the tag resulting from
180+
the most recent call to `lf_schedule` for the same action.
181+
:::warning
182+
Since calls to `lf_schedule` can specify arbitrary extra delays,
183+
`<min_spacing>` does not necessarily result in events with minimum spacing between them.
184+
If your calls to `lf_schedule` result in monotonically increasing tags, however, you will
185+
get events with minimum spacing between them.
186+
:::
174187

175188
<ShowIfs>
176189
<ShowIf c py>

0 commit comments

Comments
 (0)