@ap3x/cadence 0.1.0 → 0.1.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/README.md +20 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,10 +13,28 @@ npm install @ap3x/cadence
|
|
|
13
13
|
## What's inside
|
|
14
14
|
|
|
15
15
|
- **Schedules** — cron expressions, fixed intervals, and one-shot timers.
|
|
16
|
-
- **Exactly-once** —
|
|
17
|
-
|
|
16
|
+
- **Exactly-once slot advance** — claiming a due occurrence and advancing its slot happen in one
|
|
17
|
+
critical section, so a given occurrence is never fired twice by the running engine. A crash
|
|
18
|
+
*between* the two releases the claim, and the occurrence fires again on restart — the design
|
|
19
|
+
prefers re-firing over silently dropping a scheduled run.
|
|
20
|
+
- **Durable across restarts** — state reloads from the store; in-flight attempts abandoned by a
|
|
21
|
+
crashed process are reclaimed and routed through the retry ladder.
|
|
22
|
+
- **Overlap + misfire policies** — choose what happens when an occurrence comes due while the
|
|
23
|
+
previous attempt is still running (`allow`, `queue`, `skip_if_running`), and what to do with
|
|
24
|
+
occurrences missed while the engine was down.
|
|
25
|
+
- **Pluggable stores** — in-memory and file-backed stores ship with the package, behind a store
|
|
26
|
+
interface with a conformance suite.
|
|
18
27
|
- **Injectable clock** — no wall-clock reads in core, so schedules are testable deterministically.
|
|
19
28
|
|
|
29
|
+
## Concurrency scope
|
|
30
|
+
|
|
31
|
+
The bundled stores hold their claim in process memory and rely on JavaScript's run-to-completion
|
|
32
|
+
as the critical section. **Run one engine process per store directory** — multi-process exclusion
|
|
33
|
+
is out of scope for the in-memory and file stores.
|
|
34
|
+
|
|
35
|
+
The `Store` interface is designed for it: a backend that can claim and advance in one transaction
|
|
36
|
+
(a Postgres row lock, say) extends the same guarantee across processes. No such adapter ships here.
|
|
37
|
+
|
|
20
38
|
Depends on no other `@ap3x` package.
|
|
21
39
|
|
|
22
40
|
## Documentation
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ap3x/cadence",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Durable scheduler — cron, interval, and one-shot jobs with exactly-once
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Durable scheduler — cron, interval, and one-shot jobs with exactly-once slot advance",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/AP3X-Dev/AP3X.git",
|