@zukhruf/pool 0.8.162 → 0.8.163

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.
@@ -7,14 +7,11 @@ import { type WorkerKind } from './worker-kind.ts';
7
7
  import type { Worker } from './worker.ts';
8
8
  /**
9
9
  * Offers this host's workers of one kind, and owns them while this host
10
- * leads the election of the kind's store (ADR 0013). A standby starts no
11
- * worker (ADR 0023). The owner takes as many jobs from the queue of its
12
- * revision as it has free workers, runs each on a worker, and settles it with
13
- * complete or fail (ADR 0017), so its sizing caps the jobs of its computer
14
- * (ADR 0016). While a job runs, the owner touches it every 5 s, and kills its
15
- * worker when the store took the job back or the kind's time limit ends. The
16
- * disposal is a hand-over: it stops fetching, waits for the running jobs,
17
- * resigns, and then closes the workers (ADR 0023).
10
+ * leads the election of the kind's store (ADR 0013): a `LeaderSelector` runs
11
+ * the owner with each term that the host wins, and campaigns again after it
12
+ * (ADR 0024). A standby starts no worker (ADR 0023). The disposal is a
13
+ * hand-over: the owner stops fetching, waits for the running jobs, resigns,
14
+ * and then closes the workers (ADR 0023).
18
15
  */
19
16
  export declare class PoolWorkers<Input, Output> implements AsyncDisposable {
20
17
  #private;
@@ -1 +1 @@
1
- {"version":3,"file":"pool-workers.d.ts","sourceRoot":"","sources":["../src/pool-workers.ts"],"names":[],"mappings":"AAEA,OAAO,EAA2B,KAAK,SAAS,EAAS,MAAM,gBAAgB,CAAC;AAMhF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,C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CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAChC,4FAA4F;QAC5F,KAAK,EAAE,MAAM,CAAC;QACd,4FAA4F;QAC5F,KAAK,EAAE,SAAS,CAAC;QACjB,MAAM,EAAE,MAAM,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACpC,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,QAAQ,CAAC;KACpB,EAqDA;IAED,8EAA8E;IAC9E,IAAI,KAAK,IAAI,SAAS,CAErB;IAED;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAErB;IAwEK,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAG3C;CACF"}
@@ -1,40 +1,34 @@
1
- import { Cond, Future, WaitGroup, delay } from '@zukhruf/async';
2
- import { SqliteElection } from '@zukhruf/election';
3
- import { isErrno } from '@zukhruf/fs';
4
- import { NoServerError, PipeAddress } from '@zukhruf/pipes';
5
- import { CallerPresence } from './caller-presence.js';
1
+ import { Backoff, Future, WaitGroup, untilAborted, } from '@zukhruf/async';
2
+ import { LeaderSelector, SqliteElection } from '@zukhruf/election';
3
+ import { Owner } from './owner.js';
6
4
  import { PoolWarning } from './pool-warning.js';
7
- import { Slots } from './slots.js';
8
- import { Store, TOUCH_INTERVAL } from './store.js';
9
- import { newJobChannel, outputChannel, } from './worker-kind.js';
10
- // The read of the store that finds the jobs that no wake told of (ADR 0018).
11
- const BACKSTOP = 1_000;
12
- // The codes of a connection to a caller whose program is gone: the connection
13
- // broke. A connect that finds the caller gone rejects with NoServerError.
14
- const GONE = new Set(['ECONNRESET', 'EPIPE']);
15
- const STANDBY = {
16
- stats: () => ({ starting: 0, idle: 0, lent: 0, waiting: 0 }),
17
- };
5
+ import { Store } from './store.js';
6
+ import { newJobChannel } from './worker-kind.js';
7
+ // client-go's RetryPeriod, which "core clients default ... to 2 seconds", with
8
+ // its JitterFactor of 1.2: each wait after a failed campaign is 2 s plus up to
9
+ // 1.2 times 2 s, so 2 s to 4.4 s (ADR 0024). That is 3.2 s ± 37.5 %.
10
+ const RETRY_PERIOD = 2_000;
11
+ const JITTER_FACTOR = 1.2;
12
+ const CAMPAIGN_RETRY = new Backoff({
13
+ initial: RETRY_PERIOD * (1 + JITTER_FACTOR / 2),
14
+ multiplier: 1,
15
+ max: RETRY_PERIOD * (1 + JITTER_FACTOR / 2),
16
+ jitter: { kind: 'ratio', ratio: JITTER_FACTOR / (2 + JITTER_FACTOR) },
17
+ });
18
18
  /**
19
19
  * Offers this host's workers of one kind, and owns them while this host
20
- * leads the election of the kind's store (ADR 0013). A standby starts no
21
- * worker (ADR 0023). The owner takes as many jobs from the queue of its
22
- * revision as it has free workers, runs each on a worker, and settles it with
23
- * complete or fail (ADR 0017), so its sizing caps the jobs of its computer
24
- * (ADR 0016). While a job runs, the owner touches it every 5 s, and kills its
25
- * worker when the store took the job back or the kind's time limit ends. The
26
- * disposal is a hand-over: it stops fetching, waits for the running jobs,
27
- * resigns, and then closes the workers (ADR 0023).
20
+ * leads the election of the kind's store (ADR 0013): a `LeaderSelector` runs
21
+ * the owner with each term that the host wins, and campaigns again after it
22
+ * (ADR 0024). A standby starts no worker (ADR 0023). The disposal is a
23
+ * hand-over: the owner stops fetching, waits for the running jobs, resigns,
24
+ * and then closes the workers (ADR 0023).
28
25
  */
29
26
  export class PoolWorkers {
30
27
  #kind;
31
28
  #clock;
32
- #create;
33
- #size;
34
- #startup;
35
- #eviction;
36
29
  #store;
37
30
  #election;
31
+ #owner;
38
32
  #disposed = new AbortController();
39
33
  // Aborts, with a DeprecatedRevisionError, once the store holds a newer
40
34
  // revision of the kind: the host then offers its workers no more (ADR 0022).
@@ -46,28 +40,25 @@ export class PoolWorkers {
46
40
  // The reads of the revisions that a wake started, which end before the
47
41
  // store closes.
48
42
  #reads = new WaitGroup();
49
- // Broadcasts when a run ends, the sizing changes, the backstop ends, or a
50
- // host tells of a new job of the kind (ADR 0018).
51
- #changed = new Cond();
52
- // Counts the news of a new job. News that comes while a fetch reads the
53
- // store finds no wait on the cond, so the owner compares the count from
54
- // before the fetch, as pg-boss's worker checks beenNotified.
55
- #heard = 0;
56
43
  // Settles when the host stops offering its workers, and fails with the
57
44
  // failure that stopped it, if one did.
58
45
  #ended;
59
46
  // Settles at the first term, by the startup of its workers. A host that
60
47
  // stops offering its workers before that rejects it.
61
48
  #ready = new Future();
62
- #role = STANDBY;
63
49
  constructor(options) {
64
50
  this.#kind = options.kind;
65
51
  this.#clock = options.clock;
66
- this.#create = options.create;
67
- this.#size = options.size;
68
- this.#startup = options.startup;
69
- this.#eviction = options.eviction;
70
52
  this.#store = new Store(options.store, options.clock);
53
+ this.#owner = new Owner({
54
+ kind: options.kind,
55
+ store: this.#store,
56
+ clock: options.clock,
57
+ create: options.create,
58
+ size: options.size,
59
+ startup: options.startup,
60
+ eviction: options.eviction,
61
+ });
71
62
  const { queue } = options.kind;
72
63
  this.#store.queue.on('error', (error) => process.emitWarning(new PoolWarning(error, { code: 'ZUKHRUF_POOL_QUEUE_ERROR', queue })));
73
64
  this.#store.notifications.on('error', (error) => process.emitWarning(new PoolWarning(error, {
@@ -84,8 +75,7 @@ export class PoolWorkers {
84
75
  const read = this.#reads.add();
85
76
  void this.#learn().finally(() => read[Symbol.dispose]());
86
77
  }
87
- this.#heard++;
88
- this.#changed.broadcast();
78
+ this.#owner.hear();
89
79
  });
90
80
  this.#election = new SqliteElection({
91
81
  directory: this.#store.folder,
@@ -94,11 +84,12 @@ export class PoolWorkers {
94
84
  clock: options.clock,
95
85
  });
96
86
  this.#ended = Future.run(() => this.#live());
87
+ this.#owner.ready().then(() => this.#ready.resolve(), (error) => this.#ready.reject(error));
97
88
  this.#ended.wait().then(() => this.#ready.reject(this.#offering.reason), (error) => this.#ready.reject(error));
98
89
  }
99
90
  /** This host's slots: zero in each count while it does not own (ADR 0013). */
100
91
  get stats() {
101
- return this.#role.stats();
92
+ return this.#owner.stats;
102
93
  }
103
94
  /**
104
95
  * Resolves when this host owns and the workers that its startup starts are
@@ -121,14 +112,7 @@ export class PoolWorkers {
121
112
  // It tells of its revision, so an older owner steps down and an older
122
113
  // standby ends its campaign with no job of this revision sent.
123
114
  this.#store.tell(newJobChannel(this.#kind), String(this.#kind.revision));
124
- while (!offering.aborted) {
125
- const term = await this.#election.campaign({
126
- timeout: Infinity,
127
- signal: offering,
128
- });
129
- // A campaign with no time limit resolves only with a term.
130
- await this.#own(term, offering);
131
- }
115
+ await this.#lead(offering);
132
116
  }
133
117
  catch (error) {
134
118
  if (error !== offering.reason)
@@ -139,6 +123,29 @@ export class PoolWorkers {
139
123
  await this.#store[Symbol.asyncDispose]();
140
124
  }
141
125
  }
126
+ // Leads until the host stops offering its workers: then the dispose of the
127
+ // selector ends the term that runs and starts no round after it.
128
+ async #lead(offering) {
129
+ offering.throwIfAborted();
130
+ await using selector = LeaderSelector.start(this.#election, { takeLeadership: (term, signal) => this.#own(term, signal) }, { autoRequeue: { backoff: CAMPAIGN_RETRY, clock: this.#clock } });
131
+ // Waits until the host stops offering its workers, or a failure ended
132
+ // the selector. Only the dispose rejects with that failure: a rejection
133
+ // here too would wrap it in a SuppressedError.
134
+ try {
135
+ await untilAborted(Promise.allSettled([selector.ended]), offering);
136
+ }
137
+ catch (error) {
138
+ if (error !== offering.reason)
139
+ throw error;
140
+ }
141
+ }
142
+ // A standby whose wake of a newer revision came after the owner resigned,
143
+ // or was lost, learns of it before it starts a worker. The deprecation
144
+ // reaches the owner at once, before the dispose of the selector does.
145
+ async #own(term, signal) {
146
+ await this.#learn();
147
+ await this.#owner.takeLeadership(term, AbortSignal.any([signal, this.#offering]));
148
+ }
142
149
  // Deprecates this host for good once the store holds a newer revision of
143
150
  // the kind (ADR 0022). A read that fails is a warning, and the next turn or
144
151
  // wake reads again.
@@ -155,299 +162,9 @@ export class PoolWorkers {
155
162
  }));
156
163
  }
157
164
  }
158
- // Owns until the stop, or until the term is lost: then it campaigns again.
159
- async #own(term, stop) {
160
- // A standby whose wake of a newer revision came after the owner resigned,
161
- // or was lost, learns of it before it starts a worker.
162
- await this.#learn();
163
- if (stop.aborted) {
164
- await term.resign();
165
- return;
166
- }
167
- const owning = AbortSignal.any([stop, term.signal]);
168
- const running = new Set();
169
- const slots = new Slots({
170
- size: this.#size,
171
- startup: this.#startup,
172
- eviction: this.#eviction,
173
- create: this.#create,
174
- clock: this.#clock,
175
- resized: () => this.#changed.broadcast(),
176
- });
177
- // The jobs that wait for this host's workers wait in the store, so no
178
- // job waits in the host itself.
179
- this.#role = { stats: () => slots.stats(0) };
180
- slots.ready().then(() => this.#ready.resolve(), (error) => this.#ready.reject(error));
181
- // Whether the last fetch took every job it asked for, so more may wait.
182
- let backlog = false;
183
- try {
184
- while (!owning.aborted) {
185
- const free = this.#size.current - running.size;
186
- const heard = this.#heard;
187
- if (free > 0) {
188
- // A fetch that fails waits for the backstop, as pg-boss's worker
189
- // polls again after a failed fetch.
190
- const jobs = await this.#store.queue
191
- .fetch(this.#kind.queue, { batchSize: free })
192
- .catch((error) => {
193
- process.emitWarning(new PoolWarning(error, {
194
- code: 'ZUKHRUF_POOL_FETCH_FAILED',
195
- queue: this.#kind.queue,
196
- }));
197
- return [];
198
- });
199
- backlog = jobs.length === free;
200
- for (const job of jobs) {
201
- const run = this.#run(slots, job, () => backlog)
202
- // A settle that fails leaves the job to lapse by its heartbeat,
203
- // and the store runs it again by the kind's rules.
204
- .catch((error) => process.emitWarning(new PoolWarning(error, {
205
- code: 'ZUKHRUF_POOL_SETTLE_FAILED',
206
- queue: this.#kind.queue,
207
- job: job.id,
208
- })))
209
- .finally(() => {
210
- running.delete(run);
211
- this.#changed.broadcast();
212
- });
213
- running.add(run);
214
- }
215
- }
216
- // A run that ended, a resize or news of a new job during the fetch
217
- // broadcast before the rest began to wait, so check the free slots
218
- // again in the same step.
219
- if (this.#size.current - running.size > 0 &&
220
- (backlog || this.#heard !== heard))
221
- continue;
222
- await this.#rest(owning);
223
- }
224
- }
225
- finally {
226
- await Promise.all(running);
227
- // A standby takes over before the workers close: a close can be slow.
228
- await term.resign();
229
- this.#role = STANDBY;
230
- await slots[Symbol.asyncDispose]();
231
- }
232
- }
233
- // Waits for the next broadcast, or the end of the ownership. The backstop
234
- // broadcasts too, so each rest is one wait that a broadcast ends, and no
235
- // cancelled wait stays on the cond.
236
- async #rest(owning) {
237
- const backstop = this.#clock.setTimeout(() => this.#changed.broadcast(), BACKSTOP);
238
- try {
239
- await this.#changed.wait({ signal: owning });
240
- }
241
- catch (error) {
242
- if (error !== owning.reason)
243
- throw error;
244
- }
245
- finally {
246
- this.#clock.clearTimeout(backstop);
247
- }
248
- }
249
- // Runs one fetched job on a worker, and settles it by its attempt. A
250
- // worker that fails to start fails the job, as the worker's own failure.
251
- // The kind's time limit and the touches start at the fetch, as the store
252
- // counts both from it, so a warm start counts too. At the time limit the
253
- // owner kills the worker and fails the job; when the store took the job
254
- // back, it kills the worker and settles nothing.
255
- async #run(slots, job, backlog) {
256
- const attempt = { id: job.id, retryCount: job.retryCount };
257
- const slot = slots.lend();
258
- const ended = new AbortController();
259
- let connection;
260
- try {
261
- // A job of an exclusive kind may be shared, and a caller of a shared job
262
- // that is gone only leaves it (ADR 0020).
263
- const caller = this.#kind.policy === 'standard' ? callerOf(job.data) : undefined;
264
- if (caller !== undefined) {
265
- try {
266
- connection = await new PipeAddress(caller).connect();
267
- }
268
- catch (error) {
269
- if (!(error instanceof NoServerError))
270
- throw error;
271
- if (!this.#mayLive(caller, error)) {
272
- // The caller is gone before its job starts: the job never runs.
273
- await this.#forget(caller);
274
- await this.#store.queue.cancel(this.#kind.queue, job.id);
275
- return;
276
- }
277
- }
278
- }
279
- const callerEnds = [];
280
- if (caller !== undefined) {
281
- callerEnds.push(connection === undefined
282
- ? this.#presenceEnds(caller, ended.signal)
283
- : left(connection, this.#kind.queue));
284
- }
285
- const outcome = await Promise.race([
286
- this.#work(slots, slot, job.data, backlog, ended.signal),
287
- this.#watch(attempt, ended.signal),
288
- ...callerEnds,
289
- ]);
290
- ended.abort();
291
- if ('left' in outcome) {
292
- await this.#forget(caller);
293
- await this.#store.queue.cancel(this.#kind.queue, job.id);
294
- }
295
- // A settle that affects no row finds the job under another claim: the
296
- // store fenced it, and the output is dropped (ADR 0017).
297
- if ('output' in outcome)
298
- await this.#store.queue.complete(this.#kind.queue, attempt, {
299
- output: outcome.output,
300
- });
301
- else if ('failure' in outcome)
302
- await this.#store.queue.fail(this.#kind.queue, attempt, failure(outcome.failure));
303
- else if ('expired' in outcome)
304
- await this.#store.queue.fail(this.#kind.queue, attempt,
305
- // The error of pg-boss's work at the time limit (manager.js:606).
306
- failure(new Error(`handler execution exceeded ${this.#kind.expireInSeconds}s`)));
307
- // The store took a job that is gone back itself, and nobody waits for
308
- // the output of a caller that left.
309
- if (!('gone' in outcome) && !('left' in outcome))
310
- this.#store.tell(outputChannel(this.#kind), job.id);
311
- }
312
- finally {
313
- ended.abort();
314
- connection?.destroy();
315
- slots.release(slot);
316
- }
317
- }
318
- // Linux refuses a connect only when no server listens, and a full listen
319
- // queue gives EAGAIN. On macOS a live caller whose queue is full refuses
320
- // too (kern.ipc.somaxconn, #5424), so its presence tells. The other codes
321
- // find no caller at the address. A recorded copy of the #mayLive of
322
- // @zukhruf/sqlite-notify's wakes.ts (docs/copied-code.md).
323
- #mayLive(caller, error) {
324
- if (process.platform === 'linux' || !isErrno(error.cause, 'ECONNREFUSED'))
325
- return false;
326
- return CallerPresence.lives(this.#store.path, caller);
327
- }
328
- // A caller that lives but refused the connect has no connection whose
329
- // close tells of its end, so its presence is read at each touch instead.
330
- async #presenceEnds(caller, ended) {
331
- for (;;) {
332
- await delay(TOUCH_INTERVAL, { clock: this.#clock, signal: ended });
333
- if (!CallerPresence.lives(this.#store.path, caller))
334
- return { left: true };
335
- }
336
- }
337
- // Deletes the presence file of a caller that is gone. A caller that lives
338
- // keeps it, and a removal that fails leaves it for the next owner that
339
- // finds the caller gone.
340
- async #forget(caller) {
341
- try {
342
- await CallerPresence.removeIfEnded(this.#store.path, caller, this.#clock);
343
- }
344
- catch (error) {
345
- process.emitWarning(new PoolWarning(error, {
346
- code: 'ZUKHRUF_POOL_CALLER_PRESENCE_REMOVE_FAILED',
347
- queue: this.#kind.queue,
348
- }));
349
- }
350
- }
351
- // Runs the input on the worker of the slot. The end of the run kills the
352
- // worker of a run that has not ended, and leaves its outcome unread.
353
- async #work(slots, slot, data, backlog, ended) {
354
- let worker;
355
- try {
356
- worker = await slots.borrow(slot);
357
- }
358
- catch (error) {
359
- return { failure: error };
360
- }
361
- if (ended.aborted)
362
- return { gone: true };
363
- const kill = () => slots.kill(slot, worker);
364
- ended.addEventListener('abort', kill, { once: true });
365
- const started = this.#clock.performance.now();
366
- try {
367
- if (!isEnvelope(data))
368
- throw new TypeError('The job has no input: no Pool sent it.');
369
- return { output: await worker.run(data.input) };
370
- }
371
- catch (error) {
372
- return { failure: error };
373
- }
374
- finally {
375
- ended.removeEventListener('abort', kill);
376
- if (!ended.aborted)
377
- slots.record(started, backlog());
378
- }
379
- }
380
- // Touches the job every 5 s until the run ends, and resolves when the
381
- // kind's time limit ends or a touch finds that the store took the job back.
382
- async #watch(attempt, ended) {
383
- const deadline = this.#clock.performance.now() + this.#kind.expireInSeconds * 1_000;
384
- for (;;) {
385
- const remaining = deadline - this.#clock.performance.now();
386
- if (remaining <= 0)
387
- return { expired: true };
388
- await delay(Math.min(TOUCH_INTERVAL, remaining), {
389
- clock: this.#clock,
390
- signal: ended,
391
- });
392
- if (this.#clock.performance.now() >= deadline)
393
- return { expired: true };
394
- let affected;
395
- try {
396
- ({ affected } = await this.#store.queue.touch(this.#kind.queue, attempt));
397
- }
398
- catch (error) {
399
- // The job keeps its worker, and the next touch tries again.
400
- process.emitWarning(new PoolWarning(error, {
401
- code: 'ZUKHRUF_POOL_TOUCH_FAILED',
402
- queue: this.#kind.queue,
403
- job: attempt.id,
404
- }));
405
- continue;
406
- }
407
- if (affected === 0)
408
- return { gone: true };
409
- }
410
- }
411
165
  async [Symbol.asyncDispose]() {
412
166
  this.#disposed.abort();
413
167
  await this.#ended.wait();
414
168
  }
415
169
  }
416
- // The pool does not check the input itself: a sender and an owner of one
417
- // revision run the same code (ADR 0014).
418
- function isEnvelope(data) {
419
- return typeof data === 'object' && data !== null && 'input' in data;
420
- }
421
- // The pipe of the caller that a run wrote on its job, if any.
422
- function callerOf(data) {
423
- return isEnvelope(data) && typeof data.caller === 'string'
424
- ? data.caller
425
- : undefined;
426
- }
427
- function isGone(error) {
428
- return (Error.isError(error) &&
429
- 'code' in error &&
430
- typeof error.code === 'string' &&
431
- GONE.has(error.code));
432
- }
433
- // Resolves when the connection to the caller closes: its program is gone, or
434
- // its Pool was disposed. A break of the connection only ends it.
435
- function left(connection, queue) {
436
- connection.on('error', (error) => {
437
- if (!isGone(error))
438
- process.emitWarning(new PoolWarning(error, {
439
- code: 'ZUKHRUF_POOL_CALLER_CONNECTION_ERROR',
440
- queue,
441
- }));
442
- });
443
- return new Promise((resolve) => {
444
- connection.once('close', () => resolve({ left: true }));
445
- });
446
- }
447
- /** A failure as data: its name and its message (ADR 0019). */
448
- function failure(error) {
449
- return Error.isError(error)
450
- ? { name: error.name, message: error.message }
451
- : { name: 'Error', message: String(error) };
452
- }
453
170
  //# sourceMappingURL=pool-workers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pool-workers.js","sourceRoot":"","sources":["../src/pool-workers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAkB,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAa,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,WA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,SAAS,CAAC,CAAC,CAC1C,CAAC;IACJ,CAAC;IAED,yEAAyE;IACzE,4EAA4E;IAC5E,oBAAoB;IACpB,KAAK,CAAC,MAAM;QACV,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC7D,IAAI,UAAU,KAAK,SAAS;gBAAE,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACnE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,WAAW,CACjB,IAAI,WAAW,CAAC,KAAK,EAAE;gBACrB,IAAI,EAAE,oCAAoC;gBAC1C,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;aACxB,CAAC,CACH,CAAC;QACJ,CAAC;IACH,CAAC;IAED,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;QACzB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QACvB,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;CACF"}
package/dist/store.d.ts CHANGED
@@ -20,7 +20,12 @@ export declare class Store implements AsyncDisposable {
20
20
  readonly queue: SqliteJobQueue;
21
21
  readonly notifications: Notifications;
22
22
  constructor(address: string, clock: WallClock);
23
- /** Starts the queue, and creates the queue of the kind's revision with the kind's rules. */
23
+ /**
24
+ * Starts the queue, and creates the queue of the kind's revision with the
25
+ * kind's rules. It first rejects with `NetworkDirectoryError` when the
26
+ * folder is on a network file system: the locks of the SQLite file and of
27
+ * the election's claim files do not hold there, and no retry changes that.
28
+ */
24
29
  start<Input, Output>(kind: WorkerKind<Input, Output>): Promise<void>;
25
30
  /**
26
31
  * The error of a deprecated revision when the store holds the queue of a
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,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,wBAAwB,CAAC;AAEvD,OAAO,EACL,cAAc,EAEf,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,KAAK,UAAU,EAA+B,MAAM,kBAAkB,CAAC;AAShF,yGAAyG;AACzG,eAAO,MAAM,cAAc,QAAkC,CAAC;AAI9D;;;;;;GAMG;AACH,qBAAa,KAAM,YAAW,eAAe;;IAC3C,gDAAgD;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IAGtC,YAAY,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAuB5C;IAED;;;;;OAKG;IACG,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CASzE;IAED;;;;OAIG;IACG,WAAW,CAAC,KAAK,EAAE,MAAM,EAC7B,IAAI,EAAE,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,GAC9B,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAsB9C;IAED;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAQ3C;IAEK,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAI3C;CACF"}
package/dist/store.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { mkdirSync } from 'node:fs';
2
2
  import { dirname } from 'node:path';
3
+ import { assertLocalDirectory } from '@zukhruf/fs';
3
4
  import { Notifications } from '@zukhruf/sqlite-notify';
4
5
  import { WriteAheadLog, open } from '@zukhruf/sqlite-open';
5
6
  import { SqliteJobQueue, } from '@zukhruf/sqlite-queue';
@@ -49,8 +50,14 @@ export class Store {
49
50
  clock,
50
51
  });
51
52
  }
52
- /** Starts the queue, and creates the queue of the kind's revision with the kind's rules. */
53
+ /**
54
+ * Starts the queue, and creates the queue of the kind's revision with the
55
+ * kind's rules. It first rejects with `NetworkDirectoryError` when the
56
+ * folder is on a network file system: the locks of the SQLite file and of
57
+ * the election's claim files do not hold there, and no retry changes that.
58
+ */
53
59
  async start(kind) {
60
+ await assertLocalDirectory(this.folder);
54
61
  await this.queue.start();
55
62
  await this.queue.createQueue(kind.queue, {
56
63
  policy: kind.policy,
package/dist/store.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EACL,cAAc,GAEf,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAmB,UAAU,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEhF,8EAA8E;AAC9E,2EAA2E;AAC3E,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B,sDAAsD;AACtD,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,yGAAyG;AACzG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,iBAAiB,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;AAI9D;;;;;;GAMG;AACH,MAAM,OAAO,KAAK;IAChB,gDAAgD;IACvC,IAAI,CAAS;IACb,MAAM,CAAS;IACf,KAAK,CAAiB;IACtB,a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