@arkstack/queue 0.13.2 → 0.14.0
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/dist/{QueueManager-DFdwxyXk.js → QueueManager-Cd0mo56g.js} +2 -1
- package/dist/commands/QueueClearCommand.js +1 -1
- package/dist/commands/QueueWorkCommand.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/setup.d.ts +1 -0
- package/dist/setup.js +21 -0
- package/package.json +7 -5
- package/stubs/migrations/20260601000001_create_jobs_table.ts.stub +27 -0
|
@@ -156,7 +156,8 @@ const now$1 = () => Math.floor(Date.now() / 1e3);
|
|
|
156
156
|
* `attempts` (int), `reserved_at` (nullable int), `available_at` (int),
|
|
157
157
|
* `created_at` (int). Reservation marks `reserved_at` and bumps `attempts`;
|
|
158
158
|
* completion deletes the row; release clears `reserved_at` and reschedules
|
|
159
|
-
* `available_at`.
|
|
159
|
+
* `available_at`. Run `ark publish --tag queue-migrations` to add the migration
|
|
160
|
+
* that creates this table.
|
|
160
161
|
*/
|
|
161
162
|
var DatabaseQueue = class extends QueueContract {
|
|
162
163
|
options;
|
package/dist/index.d.ts
CHANGED
|
@@ -393,7 +393,8 @@ declare class SyncQueue extends QueueContract {
|
|
|
393
393
|
* `attempts` (int), `reserved_at` (nullable int), `available_at` (int),
|
|
394
394
|
* `created_at` (int). Reservation marks `reserved_at` and bumps `attempts`;
|
|
395
395
|
* completion deletes the row; release clears `reserved_at` and reschedules
|
|
396
|
-
* `available_at`.
|
|
396
|
+
* `available_at`. Run `ark publish --tag queue-migrations` to add the migration
|
|
397
|
+
* that creates this table.
|
|
397
398
|
*/
|
|
398
399
|
declare class DatabaseQueue extends QueueContract {
|
|
399
400
|
private readonly options;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as RedisQueue, c as Job, d as serializeJob, f as setResolver, i as SyncQueue, l as resetSerialization, n as configure, o as DatabaseQueue, p as setSerializer, r as Worker, s as QueueContract, t as Queue, u as resolveJob } from "./QueueManager-
|
|
1
|
+
import { a as RedisQueue, c as Job, d as serializeJob, f as setResolver, i as SyncQueue, l as resetSerialization, n as configure, o as DatabaseQueue, p as setSerializer, r as Worker, s as QueueContract, t as Queue, u as resolveJob } from "./QueueManager-Cd0mo56g.js";
|
|
2
2
|
export { DatabaseQueue, Job, Queue, QueueContract, RedisQueue, SyncQueue, Worker, configure, resetSerialization, resolveJob, serializeJob, setResolver, setSerializer };
|
package/dist/setup.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/setup.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Publisher } from "@arkstack/common";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
//#region src/setup.ts
|
|
5
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
6
|
+
/**
|
|
7
|
+
* Register the artifacts `@arkstack/queue` publishes into the application.
|
|
8
|
+
*
|
|
9
|
+
* Run `ark publish --package @arkstack/queue` (or `--tag queue-migrations`) to
|
|
10
|
+
* copy the migration for the `database` queue connection into the app.
|
|
11
|
+
*/
|
|
12
|
+
Publisher.publishes({
|
|
13
|
+
package: "@arkstack/queue",
|
|
14
|
+
tag: "queue-migrations",
|
|
15
|
+
entries: [{
|
|
16
|
+
from: join(root, "stubs/migrations/20260601000001_create_jobs_table.ts.stub"),
|
|
17
|
+
to: "src/database/migrations/20260601000001_create_jobs_table.ts"
|
|
18
|
+
}]
|
|
19
|
+
});
|
|
20
|
+
//#endregion
|
|
21
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkstack/queue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Queue module for Arkstack, providing a driver based queue transport and worker for background processing.",
|
|
6
6
|
"homepage": "https://arkstack.toneflix.net/guide/queue",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"arkstack"
|
|
21
21
|
],
|
|
22
22
|
"files": [
|
|
23
|
-
"dist"
|
|
23
|
+
"dist",
|
|
24
|
+
"stubs"
|
|
24
25
|
],
|
|
25
26
|
"publishConfig": {
|
|
26
27
|
"access": "public"
|
|
@@ -29,16 +30,17 @@
|
|
|
29
30
|
".": "./dist/index.js",
|
|
30
31
|
"./commands/QueueClearCommand": "./dist/commands/QueueClearCommand.js",
|
|
31
32
|
"./commands/QueueWorkCommand": "./dist/commands/QueueWorkCommand.js",
|
|
33
|
+
"./setup": "./dist/setup.js",
|
|
32
34
|
"./package.json": "./package.json"
|
|
33
35
|
},
|
|
34
36
|
"dependencies": {
|
|
35
|
-
"@arkstack/common": "^0.
|
|
37
|
+
"@arkstack/common": "^0.14.0"
|
|
36
38
|
},
|
|
37
39
|
"peerDependencies": {
|
|
38
40
|
"@h3ravel/musket": "^2.2.0",
|
|
39
41
|
"ioredis": "^5.4.1",
|
|
40
|
-
"@arkstack/
|
|
41
|
-
"@arkstack/
|
|
42
|
+
"@arkstack/database": "^0.14.0",
|
|
43
|
+
"@arkstack/contract": "^0.14.0"
|
|
42
44
|
},
|
|
43
45
|
"peerDependenciesMeta": {
|
|
44
46
|
"@arkstack/database": {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Migration, SchemaBuilder } from 'arkormx'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Backing table for the `database` queue connection (`@arkstack/queue`).
|
|
5
|
+
*
|
|
6
|
+
* Columns: `id` (auto increment), `queue` (string, indexed), `payload` (text),
|
|
7
|
+
* `attempts` (int), `reserved_at` (nullable epoch seconds), `available_at`
|
|
8
|
+
* (epoch seconds), `created_at` (epoch seconds). Adjust the table name to match
|
|
9
|
+
* `queue.connections.database.table`.
|
|
10
|
+
*/
|
|
11
|
+
export default class CreateJobsTableMigration extends Migration {
|
|
12
|
+
public async up (schema: SchemaBuilder): Promise<void> {
|
|
13
|
+
schema.createTable('jobs', (table) => {
|
|
14
|
+
table.id('id')
|
|
15
|
+
table.string('queue').index()
|
|
16
|
+
table.text('payload')
|
|
17
|
+
table.integer('attempts')
|
|
18
|
+
table.integer('reserved_at').nullable()
|
|
19
|
+
table.integer('available_at')
|
|
20
|
+
table.integer('created_at')
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public async down (schema: SchemaBuilder): Promise<void> {
|
|
25
|
+
schema.dropTable('jobs')
|
|
26
|
+
}
|
|
27
|
+
}
|