pg-boss 12.20.0 → 12.21.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/README.md +7 -6
- package/dist/adapters/pglite.d.ts +1 -0
- package/dist/adapters/pglite.d.ts.map +1 -1
- package/dist/adapters/pglite.js +15 -1
- package/dist/attorney.d.ts.map +1 -1
- package/dist/attorney.js +24 -2
- package/dist/cli.js +71 -4
- package/dist/contractor.d.ts +3 -1
- package/dist/contractor.d.ts.map +1 -1
- package/dist/contractor.js +5 -2
- package/dist/db.d.ts +1 -0
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +74 -0
- package/dist/index.d.ts +5 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -2
- package/dist/manager.d.ts +5 -4
- package/dist/manager.d.ts.map +1 -1
- package/dist/manager.js +267 -36
- package/dist/migrationStore.d.ts +12 -3
- package/dist/migrationStore.d.ts.map +1 -1
- package/dist/migrationStore.js +566 -729
- package/dist/notifier.d.ts +16 -0
- package/dist/notifier.d.ts.map +1 -0
- package/dist/notifier.js +81 -0
- package/dist/plans.d.ts +14 -2
- package/dist/plans.d.ts.map +1 -1
- package/dist/plans.js +205 -23
- package/dist/types.d.ts +134 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/worker.d.ts +3 -3
- package/dist/worker.d.ts.map +1 -1
- package/dist/worker.js +14 -5
- package/package.json +13 -12
package/README.md
CHANGED
|
@@ -43,15 +43,16 @@ This will likely cater the most to teams already familiar with the simplicity of
|
|
|
43
43
|
## Summary
|
|
44
44
|
* Exactly-once job delivery
|
|
45
45
|
* Create jobs in an existing db transaction, including adapters for popular ORMs such as Drizzle, Knex, Kysely, Prisma
|
|
46
|
-
* Backpressure-compatible polling workers
|
|
47
|
-
*
|
|
46
|
+
* Backpressure-compatible polling workers, including support for LISTEN/NOTIFY low latency delivery
|
|
47
|
+
* Job dependency workflow orchestration
|
|
48
|
+
* Cron scheduling, job deferral
|
|
48
49
|
* Queue storage policies to support a variety of rate limiting, debouncing, and concurrency use cases
|
|
49
|
-
* Priority queues, dead letter queues,
|
|
50
|
+
* Priority queues, dead letter queues, automatic retries with exponential backoff
|
|
50
51
|
* Pub/sub API for fan-out queue relationships
|
|
51
52
|
* SQL support for non-Node.js runtimes for most operations
|
|
52
53
|
* Serverless function compatible
|
|
53
54
|
* Multi-master compatible (for example, in a Kubernetes ReplicaSet)
|
|
54
|
-
* [Additional database backends](https://timgit.github.io/pg-boss/
|
|
55
|
+
* [Additional database backends](https://timgit.github.io/pg-boss/database-backends) for Postgres-based databases such as CockroachDB, YugabyteDB and Citus. Or, use embedded PGlite for running entirely in-process.
|
|
55
56
|
|
|
56
57
|
## CLI
|
|
57
58
|
|
|
@@ -63,13 +64,13 @@ See the [CLI documentation](https://timgit.github.io/pg-boss/cli) for details.
|
|
|
63
64
|
|
|
64
65
|
A web-based dashboard is available in the [`@pg-boss/dashboard`](https://www.npmjs.com/package/@pg-boss/dashboard) package for monitoring and managing jobs, queues and schedules.
|
|
65
66
|
|
|
66
|
-
See the [dashboard documentation](https://github.
|
|
67
|
+
See the [dashboard documentation](https://timgit.github.io/pg-boss/dashboard) for details.
|
|
67
68
|
|
|
68
69
|
## Proxy
|
|
69
70
|
|
|
70
71
|
A HTTP proxy is available in the [`@pg-boss/proxy`](https://www.npmjs.com/package/@pg-boss/proxy) package if needed to support use cases such as platform compatibility and connection pooling or scalability.
|
|
71
72
|
|
|
72
|
-
See the [proxy documentation](https://github.
|
|
73
|
+
See the [proxy documentation](https://timgit.github.io/pg-boss/proxy) for details.
|
|
73
74
|
|
|
74
75
|
## Requirements
|
|
75
76
|
* Node 22.12 or higher for CommonJS's require(esm)
|
|
@@ -6,6 +6,7 @@ export interface PGliteLike {
|
|
|
6
6
|
exec(query: string): Promise<Array<{
|
|
7
7
|
rows: any[];
|
|
8
8
|
}>>;
|
|
9
|
+
listen?(channel: string, callback: (payload: string) => void): Promise<() => Promise<void>>;
|
|
9
10
|
}
|
|
10
11
|
export declare function fromPglite(pglite: PGliteLike): IDatabase;
|
|
11
12
|
//# sourceMappingURL=pglite.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pglite.d.ts","sourceRoot":"","sources":["../../src/adapters/pglite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"pglite.d.ts","sourceRoot":"","sources":["../../src/adapters/pglite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAM5C,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,CAAC,EAAE,CAAA;KAAE,CAAC,CAAA;IACzE,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;QAAE,IAAI,EAAE,GAAG,EAAE,CAAA;KAAE,CAAC,CAAC,CAAA;IACpD,MAAM,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;CAC5F;AAUD,wBAAgB,UAAU,CAAE,MAAM,EAAE,UAAU,GAAG,SAAS,CA6CzD"}
|
package/dist/adapters/pglite.js
CHANGED
|
@@ -23,7 +23,7 @@ export function fromPglite(pglite) {
|
|
|
23
23
|
const results = await pglite.exec(text);
|
|
24
24
|
return { rows: results.flatMap(r => r.rows ?? []) };
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
const db = {
|
|
27
27
|
async executeSql(text, values) {
|
|
28
28
|
try {
|
|
29
29
|
return await run(text, values);
|
|
@@ -34,4 +34,18 @@ export function fromPglite(pglite) {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
+
// PGlite is embedded single-connection PostgreSQL, so LISTEN/NOTIFY works entirely in-process:
|
|
38
|
+
// the same instance both NOTIFYs (via pg-boss's inlined pg_notify) and delivers to listeners.
|
|
39
|
+
// Only expose `listen` when the instance actually supports it (older builds/mocks may not), so
|
|
40
|
+
// the notifier cleanly falls back to polling otherwise. There is no network connection to drop,
|
|
41
|
+
// hence no reconnect loop — onReconnect is invoked once after the initial subscribe to mirror
|
|
42
|
+
// the pooled driver and force a gap-recovery fetch.
|
|
43
|
+
if (typeof pglite.listen === 'function') {
|
|
44
|
+
db.listen = async (channel, onNotification, onReconnect) => {
|
|
45
|
+
const unsubscribe = await pglite.listen(channel, onNotification);
|
|
46
|
+
onReconnect();
|
|
47
|
+
return { close: async () => { await unsubscribe(); } };
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return db;
|
|
37
51
|
}
|
package/dist/attorney.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attorney.d.ts","sourceRoot":"","sources":["../src/attorney.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAA;AAExC,QAAA,MAAM,MAAM;;;;CAIX,CAAA;
|
|
1
|
+
{"version":3,"file":"attorney.d.ts","sourceRoot":"","sources":["../src/attorney.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAA;AAExC,QAAA,MAAM,MAAM;;;;CAIX,CAAA;AAyDD,iBAAS,iBAAiB,CAAE,MAAM,GAAE,GAAQ,QAc3C;AAED,iBAAS,aAAa,CAAE,IAAI,EAAE,GAAG,GAAG,KAAK,CAAC,OAAO,CAgDhD;AAWD,iBAAS,gBAAgB,CAAE,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,QA2D/C;AA2GD,iBAAS,aAAa,CAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG;IAClD,OAAO,EAAE,KAAK,CAAC,mBAAmB,CAAA;IAClC,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;CACjC,CA8BA;AAED,iBAAS,cAAc,CAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,QAQlD;AAED,iBAAS,SAAS,CAAE,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,kBAAkB,GAAG,KAAK,CAAC,0BAA0B,CAuB9F;AAgDD,iBAAS,wBAAwB,CAAE,IAAI,EAAE,MAAM,QAK9C;AAED,iBAAS,eAAe,CAAE,IAAI,EAAE,MAAM,QAIrC;AAED,iBAAS,SAAS,CAAE,GAAG,EAAE,MAAM,QAI9B;AAmID,OAAO,EACL,SAAS,EACT,wBAAwB,EACxB,eAAe,EACf,cAAc,EACd,aAAa,EACb,aAAa,EACb,SAAS,EACT,MAAM,EACN,gBAAgB,EAChB,iBAAiB,EAClB,CAAA"}
|
package/dist/attorney.js
CHANGED
|
@@ -14,7 +14,8 @@ const COMPATIBILITY_FLAGS = [
|
|
|
14
14
|
'noTablePartitioning',
|
|
15
15
|
'noDeferrableConstraints',
|
|
16
16
|
'noAdvisoryLocks',
|
|
17
|
-
'noCoveringIndexes'
|
|
17
|
+
'noCoveringIndexes',
|
|
18
|
+
'noListenNotify'
|
|
18
19
|
];
|
|
19
20
|
// The single source of truth for backend presets, mirrored by test/testHelper.ts.
|
|
20
21
|
const BACKEND_PROFILES = {
|
|
@@ -27,7 +28,8 @@ const BACKEND_PROFILES = {
|
|
|
27
28
|
noTablePartitioning: true,
|
|
28
29
|
noDeferrableConstraints: true,
|
|
29
30
|
noAdvisoryLocks: true,
|
|
30
|
-
noCoveringIndexes: true
|
|
31
|
+
noCoveringIndexes: true,
|
|
32
|
+
noListenNotify: true
|
|
31
33
|
}
|
|
32
34
|
},
|
|
33
35
|
yugabytedb: {
|
|
@@ -45,6 +47,7 @@ function assertObjectName(value, name = 'Name') {
|
|
|
45
47
|
}
|
|
46
48
|
function validateQueueArgs(config = {}) {
|
|
47
49
|
assert(!('deadLetter' in config) || config.deadLetter === null || (typeof config.deadLetter === 'string'), 'deadLetter must be a string');
|
|
50
|
+
assert(!('notify' in config) || typeof config.notify === 'boolean', 'notify must be a boolean');
|
|
48
51
|
if (config.deadLetter) {
|
|
49
52
|
assertObjectName(config.deadLetter, 'deadLetter');
|
|
50
53
|
}
|
|
@@ -259,6 +262,7 @@ function checkWorkArgs(name, args) {
|
|
|
259
262
|
assert(!('includeMetadata' in options) || typeof options.includeMetadata === 'boolean', 'includeMetadata must be a boolean');
|
|
260
263
|
assert(!('priority' in options) || typeof options.priority === 'boolean', 'priority must be a boolean');
|
|
261
264
|
assert(!('localConcurrency' in options) || (Number.isInteger(options.localConcurrency) && options.localConcurrency >= 1), 'localConcurrency must be an integer >= 1');
|
|
265
|
+
assert(!('perJobResults' in options) || typeof options.perJobResults === 'boolean', 'perJobResults must be a boolean');
|
|
262
266
|
validatePriorityRangeConfig(options);
|
|
263
267
|
validateGroupConcurrencyConfig(options);
|
|
264
268
|
validateHeartbeatRefreshConfig(options);
|
|
@@ -281,6 +285,7 @@ function getConfig(value) {
|
|
|
281
285
|
config.supervise = ('supervise' in config) ? config.supervise : true;
|
|
282
286
|
config.migrate = ('migrate' in config) ? config.migrate : true;
|
|
283
287
|
config.createSchema = ('createSchema' in config) ? config.createSchema : true;
|
|
288
|
+
config.useListenNotify = ('useListenNotify' in config) ? config.useListenNotify : false;
|
|
284
289
|
resolveBackend(config);
|
|
285
290
|
applySchemaConfig(config);
|
|
286
291
|
applyOpsConfig(config);
|
|
@@ -363,6 +368,23 @@ function applyPollingInterval(config) {
|
|
|
363
368
|
config.pollingInterval = ('pollingIntervalSeconds' in config)
|
|
364
369
|
? config.pollingIntervalSeconds * 1000
|
|
365
370
|
: 2000;
|
|
371
|
+
assert(!('notifyPollingIntervalSeconds' in config) || config.notifyPollingIntervalSeconds >= POLICY.MIN_POLLING_INTERVAL_MS / 1000, `configuration assert: notifyPollingIntervalSeconds must be at least every ${POLICY.MIN_POLLING_INTERVAL_MS}ms`);
|
|
372
|
+
// Relaxed backstop poll used only while NOTIFY is active for the queue; falls back to
|
|
373
|
+
// pollingInterval when notify is unavailable. It must never be smaller than the base poll —
|
|
374
|
+
// that would make a notify-active queue poll more aggressively than an idle one, the opposite
|
|
375
|
+
// of the intent. When explicit, reject a value below the base; when defaulted, floor it at the
|
|
376
|
+
// base so bumping pollingIntervalSeconds past 30s can't silently leave notify smaller.
|
|
377
|
+
if ('notifyPollingIntervalSeconds' in config) {
|
|
378
|
+
config.notifyPollingInterval = config.notifyPollingIntervalSeconds * 1000;
|
|
379
|
+
assert(config.notifyPollingInterval >= config.pollingInterval, 'configuration assert: notifyPollingIntervalSeconds must be at least pollingIntervalSeconds');
|
|
380
|
+
}
|
|
381
|
+
else {
|
|
382
|
+
config.notifyPollingInterval = Math.max(30000, config.pollingInterval);
|
|
383
|
+
}
|
|
384
|
+
// Burst triggers: no transform, just validation. Both put the worker into continuous-fetch
|
|
385
|
+
// (no delay) mode; see JobPollingOptions for precedence.
|
|
386
|
+
assert(!('burstWhenReadyExceeds' in config) || (Number.isInteger(config.burstWhenReadyExceeds) && config.burstWhenReadyExceeds >= 1), 'configuration assert: burstWhenReadyExceeds must be an integer >= 1');
|
|
387
|
+
assert(!('burstWhenBatchFull' in config) || typeof config.burstWhenBatchFull === 'boolean', 'configuration assert: burstWhenBatchFull must be a boolean');
|
|
366
388
|
}
|
|
367
389
|
function applyOpsConfig(config) {
|
|
368
390
|
assert(!('superviseIntervalSeconds' in config) || config.superviseIntervalSeconds >= 1, 'configuration assert: superviseIntervalSeconds must be at least every second');
|
package/dist/cli.js
CHANGED
|
@@ -146,6 +146,27 @@ async function createDb(config) {
|
|
|
146
146
|
await db.open();
|
|
147
147
|
return db;
|
|
148
148
|
}
|
|
149
|
+
// Like getConnectionConfig, but returns null instead of exiting when no connection is
|
|
150
|
+
// configured — used by commands (e.g. `plans`) where a connection is optional.
|
|
151
|
+
function tryGetConnectionConfig(args) {
|
|
152
|
+
const fileConfig = loadConfigFile(args.config);
|
|
153
|
+
const hasConnection = args.connectionString || process.env.PGBOSS_DATABASE_URL || fileConfig.connectionString ||
|
|
154
|
+
args.host || process.env.PGBOSS_HOST || fileConfig.host ||
|
|
155
|
+
args.database || process.env.PGBOSS_DATABASE || fileConfig.database;
|
|
156
|
+
return hasConnection ? getConnectionConfig(args) : null;
|
|
157
|
+
}
|
|
158
|
+
// Enumerates partitioned queue table names so inlined index builds can fan out across
|
|
159
|
+
// them. Returns [] on any failure (e.g. unreachable DB or pre-partition schema), leaving
|
|
160
|
+
// the export to target job_common only.
|
|
161
|
+
async function getPartitionTables(db, schema) {
|
|
162
|
+
try {
|
|
163
|
+
const result = await db.executeSql(plans.getPartitionedQueueTables(schema));
|
|
164
|
+
return result.rows.map((row) => row.table_name);
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
return [];
|
|
168
|
+
}
|
|
169
|
+
}
|
|
149
170
|
async function getSchemaVersion(db, schema) {
|
|
150
171
|
try {
|
|
151
172
|
const result = await db.executeSql(plans.versionTableExists(schema));
|
|
@@ -212,7 +233,22 @@ async function cmdMigrate(args) {
|
|
|
212
233
|
const config = getConnectionConfig(args);
|
|
213
234
|
const schema = config.schema || plans.DEFAULT_SCHEMA;
|
|
214
235
|
if (args.dryRun) {
|
|
215
|
-
|
|
236
|
+
// The CLI has no BAM worker, so inline the async index builds as direct DDL. Connect
|
|
237
|
+
// (best effort) to enumerate partitioned tables; fall back to job_common only offline.
|
|
238
|
+
let partitionTables = [];
|
|
239
|
+
try {
|
|
240
|
+
const db = await createDb(config);
|
|
241
|
+
try {
|
|
242
|
+
partitionTables = await getPartitionTables(db, schema);
|
|
243
|
+
}
|
|
244
|
+
finally {
|
|
245
|
+
await db.close();
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
catch {
|
|
249
|
+
// no reachable database: emit a job_common-only static script
|
|
250
|
+
}
|
|
251
|
+
const sql = migrationStore.migrate(schema, 0, undefined, undefined, { inlineAsync: true, partitionTables });
|
|
216
252
|
console.log('-- SQL to migrate pg-boss from version 0 to latest:');
|
|
217
253
|
console.log(sql);
|
|
218
254
|
return;
|
|
@@ -232,8 +268,15 @@ async function cmdMigrate(args) {
|
|
|
232
268
|
return;
|
|
233
269
|
}
|
|
234
270
|
console.log(`Migrating pg-boss schema "${schema}" from version ${version} to ${schemaVersion}...`);
|
|
235
|
-
|
|
271
|
+
// Inline the async index builds rather than enqueuing BAM rows that nothing will run
|
|
272
|
+
// (the CLI exits without a worker); enumerate partitions so they are covered too.
|
|
273
|
+
const partitionTables = await getPartitionTables(db, schema);
|
|
274
|
+
const { sql, concurrent } = migrationStore.migrateCommands(schema, version, undefined, undefined, { inlineAsync: true, partitionTables });
|
|
236
275
|
await db.executeSql(sql);
|
|
276
|
+
// CONCURRENTLY index builds must run outside the migration transaction, one at a time.
|
|
277
|
+
for (const statement of concurrent) {
|
|
278
|
+
await db.executeSql(statement);
|
|
279
|
+
}
|
|
237
280
|
console.log(`Successfully migrated pg-boss schema "${schema}" to version ${schemaVersion}`);
|
|
238
281
|
}
|
|
239
282
|
finally {
|
|
@@ -279,10 +322,34 @@ async function cmdPlans(args) {
|
|
|
279
322
|
console.log('-- SQL to create pg-boss schema:');
|
|
280
323
|
console.log(plans.create(schema, schemaVersion, { createSchema: true }));
|
|
281
324
|
break;
|
|
282
|
-
case 'migrate':
|
|
325
|
+
case 'migrate': {
|
|
326
|
+
// Inline the async index builds (no BAM worker runs an exported script). A connection
|
|
327
|
+
// is optional: with one, fan the builds out across partitioned tables; without one,
|
|
328
|
+
// emit a job_common-only script and note the limitation.
|
|
329
|
+
const connectionConfig = tryGetConnectionConfig(args);
|
|
330
|
+
let partitionTables = [];
|
|
331
|
+
if (connectionConfig) {
|
|
332
|
+
try {
|
|
333
|
+
const db = await createDb(connectionConfig);
|
|
334
|
+
try {
|
|
335
|
+
partitionTables = await getPartitionTables(db, schema);
|
|
336
|
+
}
|
|
337
|
+
finally {
|
|
338
|
+
await db.close();
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
catch {
|
|
342
|
+
// unreachable database: fall back to a job_common-only script
|
|
343
|
+
}
|
|
344
|
+
}
|
|
283
345
|
console.log('-- SQL to migrate pg-boss (from version 0 to latest):');
|
|
284
|
-
|
|
346
|
+
if (!connectionConfig) {
|
|
347
|
+
console.log('-- note: no database connection provided; partitioned queue tables were not enumerated.');
|
|
348
|
+
console.log('-- Run with a connection (e.g. --connection-string) to include per-partition index builds.');
|
|
349
|
+
}
|
|
350
|
+
console.log(migrationStore.migrate(schema, 0, undefined, undefined, { inlineAsync: true, partitionTables }));
|
|
285
351
|
break;
|
|
352
|
+
}
|
|
286
353
|
case 'rollback':
|
|
287
354
|
console.log(`-- SQL to rollback pg-boss from version ${schemaVersion} to ${schemaVersion - 1}:`);
|
|
288
355
|
console.log(migrationStore.rollback(schema, schemaVersion));
|
package/dist/contractor.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ declare class Contractor {
|
|
|
3
3
|
static constructionPlans(schema?: string, options?: {
|
|
4
4
|
createSchema: boolean;
|
|
5
5
|
}): string;
|
|
6
|
-
static migrationPlans(schema?: string, version?: number
|
|
6
|
+
static migrationPlans(schema?: string, version?: number, options?: {
|
|
7
|
+
partitionTables?: string[];
|
|
8
|
+
}): string;
|
|
7
9
|
static rollbackPlans(schema?: string, version?: number): string;
|
|
8
10
|
private config;
|
|
9
11
|
private db;
|
package/dist/contractor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contractor.d.ts","sourceRoot":"","sources":["../src/contractor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAA;AAIxC,cAAM,UAAU;IACd,MAAM,CAAC,iBAAiB,CAAE,MAAM,SAAuB,EAAE,OAAO;;KAAyB;IAIzF,MAAM,CAAC,cAAc,CAAE,MAAM,SAAuB,EAAE,OAAO,SAAoB;
|
|
1
|
+
{"version":3,"file":"contractor.d.ts","sourceRoot":"","sources":["../src/contractor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAA;AAIxC,cAAM,UAAU;IACd,MAAM,CAAC,iBAAiB,CAAE,MAAM,SAAuB,EAAE,OAAO;;KAAyB;IAIzF,MAAM,CAAC,cAAc,CAAE,MAAM,SAAuB,EAAE,OAAO,SAAoB,EAAE,OAAO,GAAE;QAAE,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;KAAO;IAO/H,MAAM,CAAC,aAAa,CAAE,MAAM,SAAuB,EAAE,OAAO,SAAgB;IAI5E,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,EAAE,CAAiB;IAC3B,OAAO,CAAC,UAAU,CAAmB;gBAExB,EAAE,EAAE,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,0BAA0B;IAMpE,aAAa;IAKb,WAAW;IAKX,KAAK;IAcL,KAAK;IAcL,MAAM;IASN,OAAO,CAAE,OAAO,EAAE,MAAM;IASxB,IAAI,CAAE,OAAO,EAAE,MAAM;IAKrB,QAAQ,CAAE,OAAO,EAAE,MAAM;CAIhC;AAED,eAAe,UAAU,CAAA"}
|
package/dist/contractor.js
CHANGED
|
@@ -7,8 +7,11 @@ class Contractor {
|
|
|
7
7
|
static constructionPlans(schema = plans.DEFAULT_SCHEMA, options = { createSchema: true }) {
|
|
8
8
|
return plans.create(schema, schemaVersion, options);
|
|
9
9
|
}
|
|
10
|
-
static migrationPlans(schema = plans.DEFAULT_SCHEMA, version = schemaVersion - 1) {
|
|
11
|
-
|
|
10
|
+
static migrationPlans(schema = plans.DEFAULT_SCHEMA, version = schemaVersion - 1, options = {}) {
|
|
11
|
+
// Exported plans run without a BAM worker, so inline the async index builds as direct
|
|
12
|
+
// DDL rather than job_table_run_async() enqueues (see issue #766). Callers that hold a
|
|
13
|
+
// live connection can pass partitionTables to fan the builds out across partitions.
|
|
14
|
+
return migrationStore.migrate(schema, version, undefined, undefined, { inlineAsync: true, partitionTables: options.partitionTables });
|
|
12
15
|
}
|
|
13
16
|
static rollbackPlans(schema = plans.DEFAULT_SCHEMA, version = schemaVersion) {
|
|
14
17
|
return migrationStore.rollback(schema, version);
|
package/dist/db.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ declare class Db extends EventEmitter implements types.IDatabase, types.EventsMi
|
|
|
11
11
|
open(): Promise<void>;
|
|
12
12
|
close(): Promise<void>;
|
|
13
13
|
executeSql(text: string, values?: unknown[]): Promise<import("pg").QueryResult<any>>;
|
|
14
|
+
listen(channel: string, onNotification: (payload: string) => void, onReconnect: () => void): Promise<types.ListenHandle>;
|
|
14
15
|
withTransaction<T>(fn: (db: types.IDatabase) => Promise<T>): Promise<T>;
|
|
15
16
|
}
|
|
16
17
|
export default Db;
|
package/dist/db.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,aAAa,CAAA;AAGtC,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAA;AAExC,cAAM,EAAG,SAAQ,YAAa,YAAW,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,WAAW;IACzE,OAAO,CAAC,IAAI,CAAU;IACtB,OAAO,CAAC,MAAM,CAAuB;IAGrC,MAAM,EAAE,OAAO,CAAA;gBAEF,MAAM,EAAE,KAAK,CAAC,eAAe;IAY1C,MAAM;;MAEL;IAEK,IAAI;IAMJ,KAAK;IAOL,UAAU,CAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,aAAa,CAAA;AAGtC,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAA;AAExC,cAAM,EAAG,SAAQ,YAAa,YAAW,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,WAAW;IACzE,OAAO,CAAC,IAAI,CAAU;IACtB,OAAO,CAAC,MAAM,CAAuB;IAGrC,MAAM,EAAE,OAAO,CAAA;gBAEF,MAAM,EAAE,KAAK,CAAC,eAAe;IAY1C,MAAM;;MAEL;IAEK,IAAI;IAMJ,KAAK;IAOL,UAAU,CAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE;IAoB5C,MAAM,CACV,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,EACzC,WAAW,EAAE,MAAM,IAAI,GACtB,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC;IA4ExB,eAAe,CAAC,CAAC,EAAG,EAAE,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAmB/E;AAED,eAAe,EAAE,CAAA"}
|
package/dist/db.js
CHANGED
|
@@ -42,6 +42,80 @@ class Db extends EventEmitter {
|
|
|
42
42
|
// }
|
|
43
43
|
return await this.pool.query(text, values);
|
|
44
44
|
}
|
|
45
|
+
// Opens a dedicated, session-pinned connection for LISTEN/NOTIFY. A separate pg.Client
|
|
46
|
+
// (not a pooled connection) is used so the listener never depletes the query pool and so
|
|
47
|
+
// reconnection is self-contained. On any drop the client reconnects with capped backoff
|
|
48
|
+
// and re-runs LISTEN, then calls onReconnect so the caller can recover missed messages.
|
|
49
|
+
async listen(channel, onNotification, onReconnect) {
|
|
50
|
+
assert(this.opened, 'Database not opened. Call open() before listening.');
|
|
51
|
+
let closed = false;
|
|
52
|
+
let client = null;
|
|
53
|
+
let reconnectTimer = null;
|
|
54
|
+
let attempt = 0;
|
|
55
|
+
const scheduleReconnect = () => {
|
|
56
|
+
if (closed || reconnectTimer)
|
|
57
|
+
return;
|
|
58
|
+
const backoff = Math.min(30000, 1000 * 2 ** Math.min(attempt, 5));
|
|
59
|
+
attempt++;
|
|
60
|
+
reconnectTimer = setTimeout(() => {
|
|
61
|
+
reconnectTimer = null;
|
|
62
|
+
connect().catch(() => scheduleReconnect());
|
|
63
|
+
}, backoff);
|
|
64
|
+
};
|
|
65
|
+
const connect = async () => {
|
|
66
|
+
if (closed)
|
|
67
|
+
return;
|
|
68
|
+
const next = new pg.Client(this.config);
|
|
69
|
+
next.on('error', error => {
|
|
70
|
+
this.emit('error', error);
|
|
71
|
+
if (!closed) {
|
|
72
|
+
next.removeAllListeners();
|
|
73
|
+
next.end().catch(() => { });
|
|
74
|
+
if (client === next)
|
|
75
|
+
client = null;
|
|
76
|
+
scheduleReconnect();
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
next.on('notification', msg => {
|
|
80
|
+
if (msg.payload !== undefined)
|
|
81
|
+
onNotification(msg.payload);
|
|
82
|
+
});
|
|
83
|
+
// Track the client before connecting so close() can tear down a connect still in flight
|
|
84
|
+
// (e.g. shutdown during a reconnect). If connect or LISTEN then rejects, the catch ends
|
|
85
|
+
// it and rethrows — without that, a LISTEN that fails after connect() succeeded would
|
|
86
|
+
// leak an open connection. The reconnect .catch below reschedules on failure; an initial
|
|
87
|
+
// failure propagates to the caller.
|
|
88
|
+
client = next;
|
|
89
|
+
try {
|
|
90
|
+
await next.connect();
|
|
91
|
+
await next.query(`LISTEN "${channel}"`);
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
next.removeAllListeners();
|
|
95
|
+
await next.end().catch(() => { });
|
|
96
|
+
if (client === next)
|
|
97
|
+
client = null;
|
|
98
|
+
throw err;
|
|
99
|
+
}
|
|
100
|
+
attempt = 0;
|
|
101
|
+
onReconnect();
|
|
102
|
+
};
|
|
103
|
+
await connect();
|
|
104
|
+
return {
|
|
105
|
+
close: async () => {
|
|
106
|
+
closed = true;
|
|
107
|
+
if (reconnectTimer) {
|
|
108
|
+
clearTimeout(reconnectTimer);
|
|
109
|
+
reconnectTimer = null;
|
|
110
|
+
}
|
|
111
|
+
if (client) {
|
|
112
|
+
client.removeAllListeners();
|
|
113
|
+
await client.end().catch(() => { });
|
|
114
|
+
client = null;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
45
119
|
async withTransaction(fn) {
|
|
46
120
|
assert(this.opened, 'Database not opened. Call open() before executing SQL.');
|
|
47
121
|
const client = await this.pool.connect();
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ export { JOB_STATES as states } from './plans.ts';
|
|
|
5
5
|
export { QUEUE_POLICIES as policies } from './plans.ts';
|
|
6
6
|
export declare const events: types.Events;
|
|
7
7
|
export declare function getConstructionPlans(schema?: string): string;
|
|
8
|
-
export declare function getMigrationPlans(schema?: string, version?: number
|
|
8
|
+
export declare function getMigrationPlans(schema?: string, version?: number, options?: {
|
|
9
|
+
partitionTables?: string[];
|
|
10
|
+
}): string;
|
|
9
11
|
export declare function getRollbackPlans(schema?: string, version?: number): string;
|
|
10
12
|
export declare class PgBoss extends EventEmitter<types.PgBossEventMap> {
|
|
11
13
|
#private;
|
|
@@ -27,10 +29,7 @@ export declare class PgBoss extends EventEmitter<types.PgBossEventMap> {
|
|
|
27
29
|
}): Promise<types.JobWithMetadata<T>[]>;
|
|
28
30
|
fetch<T>(name: string, options?: types.FetchOptions): Promise<types.Job<T>[]>;
|
|
29
31
|
work<ReqData, ResData = any>(name: string, handler: types.WorkHandler<ReqData, ResData>): Promise<string>;
|
|
30
|
-
work<ReqData, ResData = any>(name: string, options: types.
|
|
31
|
-
includeMetadata: true;
|
|
32
|
-
}, handler: types.WorkWithMetadataHandler<ReqData, ResData>): Promise<string>;
|
|
33
|
-
work<ReqData, ResData = any>(name: string, options: types.WorkOptions, handler: types.WorkHandler<ReqData, ResData>): Promise<string>;
|
|
32
|
+
work<ReqData, ResData = any, const O extends types.WorkOptions = types.WorkOptions>(name: string, options: O, handler: types.WorkHandlerFor<O, ReqData, ResData>): Promise<string>;
|
|
34
33
|
offWork(name: string, options?: types.OffWorkOptions): Promise<void>;
|
|
35
34
|
notifyWorker(workerId: string): void;
|
|
36
35
|
subscribe(event: string, name: string): Promise<void>;
|
|
@@ -78,7 +77,7 @@ export declare class PgBoss extends EventEmitter<types.PgBossEventMap> {
|
|
|
78
77
|
getBamEntries(): Promise<types.BamEntry[]>;
|
|
79
78
|
getDb(): types.IDatabase;
|
|
80
79
|
}
|
|
81
|
-
export type { BackendProfile, BackendOptions, BamEntry, BamEvent, BamStatusSummary, CommandResponse, CompleteOptions, ConnectionOptions, ConstructorOptions, DatabaseOptions, FetchGroupConcurrencyOptions, DependencyRef, FetchOptions, FindJobsOptions, FlowJob, GroupConcurrencyConfig, GroupOptions, IDatabase as Db, InsertOptions, Job, JobFetchOptions, JobInsert, JobOptions, JobPollingOptions, JobStates, Events, JobWithMetadata, MaintenanceOptions, OffWorkOptions, PgBossEventMap, Queue, QueueOptions, QueuePolicy, QueueResult, Request, Schedule, ScheduleOptions, SchedulingOptions, SendOptions, StopOptions, UpdateQueueOptions, Warning, WipData, WorkConcurrencyOptions, WorkerState, WorkHandler, WorkOptions, WorkWithMetadataHandler, } from './types.ts';
|
|
80
|
+
export type { BackendProfile, BackendOptions, BamEntry, BamEvent, BamStatusSummary, CommandResponse, CompleteOptions, ConnectionOptions, ConstructorOptions, DatabaseOptions, FetchGroupConcurrencyOptions, DependencyRef, FetchOptions, FindJobsOptions, FlowJob, GroupConcurrencyConfig, GroupOptions, IDatabase as Db, InsertOptions, Job, JobFetchOptions, JobInsert, JobOptions, JobPollingOptions, JobResult, JobResultStatus, JobStates, Events, JobWithMetadata, MaintenanceOptions, OffWorkOptions, PgBossEventMap, Queue, QueueOptions, QueuePolicy, QueueResult, Request, Schedule, ScheduleOptions, SchedulingOptions, SendOptions, StopOptions, UpdateQueueOptions, Warning, WipData, WorkConcurrencyOptions, WorkerState, WorkHandler, WorkOptions, WorkWithMetadataHandler, WorkHandlerFor, PerJobWorkHandler, PerJobWorkWithMetadataHandler, } from './types.ts';
|
|
82
81
|
export type { JobSpyInterface, JobSpyState, JobDataSelector, JobSelector, SpyJob, } from './spy.ts';
|
|
83
82
|
export { fromKnex, fromKysely, fromDrizzle, fromPrisma, fromPglite, } from './adapters/index.ts';
|
|
84
83
|
export type { KnexTransactionLike, KyselyTransactionLike, DrizzleTransactionLike, DrizzleSqlTagLike, PrismaTransactionLike, PGliteLike, } from './adapters/index.ts';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,aAAa,CAAA;AAStC,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAA;AAGxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AACvD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,MAMzB,CAAA;AAEF,wBAAgB,oBAAoB,CAAE,MAAM,CAAC,EAAE,MAAM,UAEpD;AAED,wBAAgB,iBAAiB,CAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,UAE7G;AAED,wBAAgB,gBAAgB,CAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,UAElE;AAED,qBAAa,MAAO,SAAQ,YAAY,CAAC,KAAK,CAAC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B,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,OAAO,EACP,sBAAsB,EACtB,WAAW,EACX,WAAW,EACX,WAAW,EACX,uBAAuB,EACvB,cAAc,EACd,iBAAiB,EACjB,6BAA6B,GAC9B,MAAM,YAAY,CAAA;AAEnB,YAAY,EACV,eAAe,EACf,WAAW,EACX,eAAe,EACf,WAAW,EACX,MAAM,GACP,MAAM,UAAU,CAAA;AAEjB,OAAO,EACL,QAAQ,EACR,UAAU,EACV,WAAW,EACX,UAAU,EACV,UAAU,GACX,MAAM,qBAAqB,CAAA;AAE5B,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,GACX,MAAM,qBAAqB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import Manager from "./manager.js";
|
|
|
5
5
|
import Timekeeper from "./timekeeper.js";
|
|
6
6
|
import Boss from "./boss.js";
|
|
7
7
|
import Bam from "./bam.js";
|
|
8
|
+
import Notifier from "./notifier.js";
|
|
8
9
|
import { delay } from "./tools.js";
|
|
9
10
|
import * as plans from "./plans.js";
|
|
10
11
|
import DbDefault from "./db.js";
|
|
@@ -20,8 +21,8 @@ export const events = Object.freeze({
|
|
|
20
21
|
export function getConstructionPlans(schema) {
|
|
21
22
|
return Contractor.constructionPlans(schema);
|
|
22
23
|
}
|
|
23
|
-
export function getMigrationPlans(schema, version) {
|
|
24
|
-
return Contractor.migrationPlans(schema, version);
|
|
24
|
+
export function getMigrationPlans(schema, version, options) {
|
|
25
|
+
return Contractor.migrationPlans(schema, version, options);
|
|
25
26
|
}
|
|
26
27
|
export function getRollbackPlans(schema, version) {
|
|
27
28
|
return Contractor.rollbackPlans(schema, version);
|
|
@@ -38,6 +39,7 @@ export class PgBoss extends EventEmitter {
|
|
|
38
39
|
#manager;
|
|
39
40
|
#timekeeper;
|
|
40
41
|
#bam;
|
|
42
|
+
#notifier;
|
|
41
43
|
constructor(value) {
|
|
42
44
|
super();
|
|
43
45
|
this.#stoppingOn = null;
|
|
@@ -55,15 +57,19 @@ export class PgBoss extends EventEmitter {
|
|
|
55
57
|
const timekeeper = new Timekeeper(db, manager, config);
|
|
56
58
|
manager.timekeeper = timekeeper;
|
|
57
59
|
const bam = new Bam(db, config);
|
|
60
|
+
const notifier = new Notifier(db, manager, config);
|
|
61
|
+
manager.notifier = notifier;
|
|
58
62
|
this.#promoteEvents(manager);
|
|
59
63
|
this.#promoteEvents(boss);
|
|
60
64
|
this.#promoteEvents(timekeeper);
|
|
61
65
|
this.#promoteEvents(bam);
|
|
66
|
+
this.#promoteEvents(notifier);
|
|
62
67
|
this.#boss = boss;
|
|
63
68
|
this.#contractor = contractor;
|
|
64
69
|
this.#manager = manager;
|
|
65
70
|
this.#timekeeper = timekeeper;
|
|
66
71
|
this.#bam = bam;
|
|
72
|
+
this.#notifier = notifier;
|
|
67
73
|
}
|
|
68
74
|
#promoteEvents(emitter) {
|
|
69
75
|
for (const event of Object.values(emitter?.events)) {
|
|
@@ -87,6 +93,9 @@ export class PgBoss extends EventEmitter {
|
|
|
87
93
|
await this.#contractor.check();
|
|
88
94
|
}
|
|
89
95
|
await this.#manager.start();
|
|
96
|
+
if (this.#config.useListenNotify) {
|
|
97
|
+
await this.#notifier.start();
|
|
98
|
+
}
|
|
90
99
|
if (this.#config.supervise) {
|
|
91
100
|
await this.#boss.start();
|
|
92
101
|
}
|
|
@@ -134,6 +143,7 @@ export class PgBoss extends EventEmitter {
|
|
|
134
143
|
let { close = true, graceful = true, timeout = 30000 } = options;
|
|
135
144
|
timeout = Math.max(timeout, 1000);
|
|
136
145
|
this.#stoppingOn = Date.now();
|
|
146
|
+
await this.#notifier.stop();
|
|
137
147
|
await this.#manager.stop();
|
|
138
148
|
await this.#timekeeper.stop();
|
|
139
149
|
await this.#boss.stop();
|
package/dist/manager.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import EventEmitter from 'node:events';
|
|
2
2
|
import type Db from './db.ts';
|
|
3
|
+
import type Notifier from './notifier.ts';
|
|
3
4
|
import type Timekeeper from './timekeeper.ts';
|
|
4
5
|
import * as types from './types.ts';
|
|
5
6
|
import Worker from './worker.ts';
|
|
@@ -20,6 +21,7 @@ declare class Manager extends EventEmitter implements types.EventsMixin {
|
|
|
20
21
|
queueCacheInterval: NodeJS.Timeout | undefined;
|
|
21
22
|
wipInterval: NodeJS.Timeout | undefined;
|
|
22
23
|
timekeeper: Timekeeper | undefined;
|
|
24
|
+
notifier: Notifier | undefined;
|
|
23
25
|
queues: Record<string, types.QueueResult> | null;
|
|
24
26
|
pendingOffWorkCleanups: Set<Promise<any>>;
|
|
25
27
|
constructor(db: types.IDatabase, config: types.ResolvedConstructorOptions);
|
|
@@ -33,10 +35,7 @@ declare class Manager extends EventEmitter implements types.EventsMixin {
|
|
|
33
35
|
stop(): Promise<void>;
|
|
34
36
|
failWip(): Promise<void>;
|
|
35
37
|
work<ReqData>(name: string, handler: types.WorkHandler<ReqData>): Promise<string>;
|
|
36
|
-
work<ReqData>(name: string, options: types.
|
|
37
|
-
includeMetadata: true;
|
|
38
|
-
}, handler: types.WorkWithMetadataHandler<ReqData>): Promise<string>;
|
|
39
|
-
work<ReqData>(name: string, options: types.WorkOptions, handler: types.WorkHandler<ReqData>): Promise<string>;
|
|
38
|
+
work<ReqData, const O extends types.WorkOptions = types.WorkOptions>(name: string, options: O, handler: types.WorkHandlerFor<O, ReqData>): Promise<string>;
|
|
40
39
|
private addWorker;
|
|
41
40
|
private removeWorker;
|
|
42
41
|
private getWorkers;
|
|
@@ -47,6 +46,8 @@ declare class Manager extends EventEmitter implements types.EventsMixin {
|
|
|
47
46
|
hasPendingCleanups(): boolean;
|
|
48
47
|
offWork(name: string, options?: types.OffWorkOptions): Promise<void>;
|
|
49
48
|
notifyWorker(workerId: string): void;
|
|
49
|
+
notifyQueue(name: string): void;
|
|
50
|
+
forceFetchLnWorkers(): void;
|
|
50
51
|
subscribe(event: string, name: string): Promise<void>;
|
|
51
52
|
unsubscribe(event: string, name: string): Promise<void>;
|
|
52
53
|
publish(event: string, data?: object, options?: types.SendOptions): Promise<void>;
|
package/dist/manager.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,aAAa,CAAA;AAGtC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,aAAa,CAAA;AAGtC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAEzC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAG7C,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAU,KAAK,eAAe,EAAE,MAAM,UAAU,CAAA;AAmDvD,cAAM,OAAQ,SAAQ,YAAa,YAAW,KAAK,CAAC,WAAW;;IAC7D,MAAM;;;MAAS;IACf,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,GAAG;QAAE,MAAM,CAAC,EAAE,KAAK,CAAA;KAAE,CAAC,GAAG,EAAE,CAAA;IAC/C,MAAM,EAAE,KAAK,CAAC,0BAA0B,CAAA;IACxC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,OAAO,EAAE,OAAO,GAAG,SAAS,CAAA;IAC5B,kBAAkB,EAAE,MAAM,CAAC,OAAO,GAAG,SAAS,CAAA;IAC9C,WAAW,EAAE,MAAM,CAAC,OAAO,GAAG,SAAS,CAAA;IACvC,UAAU,EAAE,UAAU,GAAG,SAAS,CAAA;IAClC,QA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