@orkestrel/queue 0.0.11 → 0.0.13
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 +12 -18
- package/dist/src/core/index.cjs +212 -174
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +255 -134
- package/dist/src/core/index.d.ts +255 -134
- package/dist/src/core/index.js +211 -176
- package/dist/src/core/index.js.map +1 -1
- package/package.json +17 -19
package/README.md
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
# @orkestrel/queue
|
|
2
2
|
|
|
3
|
-
A concurrent, cooperative
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
unfinished work; `DatabaseQueueStore` persists over any driver, and
|
|
13
|
-
`MemoryQueueStore` is the zero-plumbing in-process default. The queue is
|
|
14
|
-
observable (a typed `emitter` surfaces `enqueue` / `start` / `retry` /
|
|
15
|
-
`success` / `failure` / `abort` / `drain`) and deliberately de-bloated — no
|
|
16
|
-
scheduler, no priorities. Environment-agnostic — no I/O, no browser or server
|
|
17
|
-
assumptions. Part of the `@orkestrel` line.
|
|
3
|
+
> A concurrent, cooperative FIFO job queue: a bounded-concurrency engine that runs each
|
|
4
|
+
> enqueued input through a handler with retries and a per-attempt timeout or abort, and
|
|
5
|
+
> hands back one promise per `enqueue` that settles with that job's result.
|
|
6
|
+
|
|
7
|
+
Create a queue with the `createQueue` function, hand it the handler that does the work, and
|
|
8
|
+
await each input's result. Pass a `store` where the unfinished work must survive a restart,
|
|
9
|
+
and subscribe to the `emitter` where a logger, a metric, or a trace needs the lifecycle
|
|
10
|
+
moments. Environment-agnostic — no I/O, no browser or server assumptions. Part of the
|
|
11
|
+
`@orkestrel` line.
|
|
18
12
|
|
|
19
13
|
## Install
|
|
20
14
|
|
|
@@ -24,8 +18,8 @@ npm install @orkestrel/queue
|
|
|
24
18
|
|
|
25
19
|
## Requirements
|
|
26
20
|
|
|
27
|
-
- Node.js >=
|
|
28
|
-
- ESM
|
|
21
|
+
- Node.js >= 22.12.0
|
|
22
|
+
- ESM and CommonJS builds from one entry point
|
|
29
23
|
|
|
30
24
|
## Usage
|
|
31
25
|
|
|
@@ -47,7 +41,7 @@ const status = await queue.enqueue('https://example.com')
|
|
|
47
41
|
For the full surface — the `Queue` engine, options, the durable
|
|
48
42
|
`QueueStoreInterface` (`MemoryQueueStore` / `DatabaseQueueStore`), the
|
|
49
43
|
observable `emitter`, and usage patterns — see
|
|
50
|
-
[`guides/
|
|
44
|
+
[`guides/queue.md`](guides/queue.md).
|
|
51
45
|
|
|
52
46
|
## Package
|
|
53
47
|
|