@plurnk/plurnk-schedule 1.20.0 → 1.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/schedule.md +16 -25
- package/package.json +3 -3
package/docs/schedule.md
CHANGED
|
@@ -3,17 +3,9 @@
|
|
|
3
3
|
A schedule delivers a message to a worker at each occurrence of a recurrence
|
|
4
4
|
rule. The rule is RFC 5545 text, the `RRULE` grammar calendars use, and the
|
|
5
5
|
message arrives like any other, from `schedule://<alias>`, joining the
|
|
6
|
-
worker's live loop or starting one.
|
|
7
|
-
tells the time when
|
|
8
|
-
|
|
9
|
-
## When to reach for a schedule
|
|
10
|
-
|
|
11
|
-
- Work that recurs on the calendar: a daily summary, an hourly check, one
|
|
12
|
-
reminder at a set time.
|
|
13
|
-
- Something external to wait for that sends no signal: schedule the check
|
|
14
|
-
instead of polling from inside a loop.
|
|
15
|
-
- Not for a child worker or a task you started: those wake you when they
|
|
16
|
-
conclude.
|
|
6
|
+
worker's live loop or starting one. The packet carries no clock: `discover`
|
|
7
|
+
tells the time when asked. A child's conclusion and a stream's settlement wake
|
|
8
|
+
the loop without a rule.
|
|
17
9
|
|
|
18
10
|
## discover: read the time, preview a rule
|
|
19
11
|
|
|
@@ -22,29 +14,28 @@ Its summary opens with the current time in the effective zone and previews
|
|
|
22
14
|
the first occurrences; its definition carries the rule as it would be stored.
|
|
23
15
|
Nothing is persisted.
|
|
24
16
|
|
|
25
|
-
|
|
17
|
+
```schedule (discover) <!-- what time is it, and when would this fire -->
|
|
26
18
|
{"source": "FREQ=DAILY;BYHOUR=9;BYMINUTE=0;BYSECOND=0;COUNT=20"}
|
|
27
|
-
|
|
19
|
+
```
|
|
28
20
|
|
|
29
21
|
## add
|
|
30
22
|
|
|
31
|
-
`add` persists the rule for this workspace and arms it. It is a host
|
|
32
|
-
|
|
23
|
+
`add` persists the rule for this workspace and arms it. It is a host effect,
|
|
24
|
+
admitted under the loop's policy.
|
|
33
25
|
|
|
34
|
-
|
|
35
|
-
{"alias": "
|
|
36
|
-
|
|
26
|
+
```schedule (add)
|
|
27
|
+
{"alias": "daily", "definition": {"rule": "FREQ=DAILY;BYHOUR=9;BYMINUTE=0;BYSECOND=0;COUNT=20", "target": "worker://alice", "prompt": "Text delivered at each occurrence."}}
|
|
28
|
+
```
|
|
37
29
|
|
|
38
30
|
- `rule`: bare `FREQ=…` parts, or a `DTSTART` line and an `RRULE` line. A
|
|
39
|
-
workspace rule ends:
|
|
31
|
+
workspace rule ends: it carries `COUNT` or `UNTIL`. Without a `DTSTART` the
|
|
40
32
|
rule starts at the next whole second when added; `BYHOUR`, `BYMINUTE`,
|
|
41
33
|
`BYSECOND` and `BYDAY` place it.
|
|
42
34
|
- `target`: the worker that receives the message, `worker://<name>`; any
|
|
43
|
-
worker in this workspace,
|
|
35
|
+
worker in this workspace, the sender included.
|
|
44
36
|
- `prompt`: the message delivered at each occurrence.
|
|
45
|
-
- `policy`: `{"proposals": "accept"}`
|
|
46
|
-
|
|
47
|
-
default holds.
|
|
37
|
+
- `policy`: `{"proposals": "accept"}` sets the proposal policy of a loop the
|
|
38
|
+
delivery starts; absent, the worker's default holds.
|
|
48
39
|
|
|
49
40
|
Times are read in `TZ`: the workspace's `env` family sets it for every rule
|
|
50
41
|
and every command; UTC otherwise.
|
|
@@ -58,5 +49,5 @@ worker is gone, is `unavailable` with the exact Problem; `enable` retries it.
|
|
|
58
49
|
|
|
59
50
|
## Receiving a scheduled message
|
|
60
51
|
|
|
61
|
-
It arrives as an open message from `schedule://<alias>`, in the loop
|
|
62
|
-
in or in a new one
|
|
52
|
+
It arrives as an open message from `schedule://<alias>`, in the loop the
|
|
53
|
+
worker is in or in a new one, and is answered as any message is.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plurnk/plurnk-schedule",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.1",
|
|
4
4
|
"description": "Scheduled messages for Plurnk workers, on RFC 5545 recurrence rules",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"rrule-temporal": "2.2.6"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@plurnk/plurnk-contracts": "^1.
|
|
45
|
-
"@plurnk/plurnk-schemes": "^1.
|
|
44
|
+
"@plurnk/plurnk-contracts": "^1.21.1",
|
|
45
|
+
"@plurnk/plurnk-schemes": "^1.21.1"
|
|
46
46
|
},
|
|
47
47
|
"keywords": [
|
|
48
48
|
"plurnk",
|