@makerkit/workers-outbox 0.0.1 → 0.0.2
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 +16 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -976,6 +976,22 @@ const job = await getJob(db, { id: jobId, tenantKey: user.orgId }); // null when
|
|
|
976
976
|
const dead = await listJobs(db, { status: 'dead', limit: 50, statementTimeoutMs: 5_000 });
|
|
977
977
|
```
|
|
978
978
|
|
|
979
|
+
`listJobs` defaults to oldest first. Set `order: 'desc'` for newest first; both creation time and job ID use that direction. Pass `nextCursor` back as `cursor` with the same filters and order. Drop the cursor when either changes.
|
|
980
|
+
|
|
981
|
+
Omit `status` in `listJobs` or `countJobs` to include all statuses. Tenant scoping is independent: continue passing `tenantKey` for tenant dashboards. `createdAtOrAfter` includes its boundary; `createdAfter`, `createdBefore`, `finishedAfter` and `finishedBefore` remain exclusive.
|
|
982
|
+
|
|
983
|
+
```ts
|
|
984
|
+
const latest = await listJobs(db, {
|
|
985
|
+
tenantKey: user.orgId,
|
|
986
|
+
createdAtOrAfter: new Date('2026-11-01T00:00:00.000Z'),
|
|
987
|
+
createdBefore: new Date('2026-12-01T00:00:00.000Z'),
|
|
988
|
+
order: 'desc',
|
|
989
|
+
limit: 50,
|
|
990
|
+
});
|
|
991
|
+
```
|
|
992
|
+
|
|
993
|
+
`countBacklog` includes `pending` and `retrying` counts for each kind. These count all jobs in those statuses, including future jobs. `due`, `aged`, `scheduled`, `processing`, `stuck` and backlog severity retain their existing meanings.
|
|
994
|
+
|
|
979
995
|
## Best practices
|
|
980
996
|
|
|
981
997
|
**Enqueueing**
|