@ultimat3/storage 27.4.0 → 27.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultimat3/storage",
3
- "version": "27.4.0",
3
+ "version": "27.5.0",
4
4
  "description": "Named disks over Bun.file and Bun.s3: safe keys, signed URLs, sniffed uploads",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -32,6 +32,6 @@
32
32
  "test": "bun test"
33
33
  },
34
34
  "dependencies": {
35
- "@ultimat3/core": "27.4.0"
35
+ "@ultimat3/core": "27.5.0"
36
36
  }
37
37
  }
@@ -33,7 +33,13 @@ import {
33
33
  } from './driver';
34
34
  import { etagOfFile, headObject, readObjectBytes, readSidecar } from './driver-local-read';
35
35
  import { lockOfSidecar, type Sidecar, sidecarLock } from './driver-local-sidecar';
36
- import { commitObject, keyedQueue, pendingPathOf, sidecarPathOf } from './driver-local-write';
36
+ import {
37
+ commitObject,
38
+ type KeyedQueue,
39
+ keyedQueue,
40
+ pendingPathOf,
41
+ sidecarPathOf,
42
+ } from './driver-local-write';
37
43
  import { checksumMismatch, deleteFailed, getTooLarge, listFailed, objectNotFound } from './errors';
38
44
  import {
39
45
  assertObjectLockOptions,
@@ -85,6 +91,11 @@ export interface LocalDriverOptions {
85
91
  * is the uploader's, not this process's. Defaults to `maxPutBytes`; past it, `stream()`.
86
92
  */
87
93
  readonly maxGetBytes?: number | undefined;
94
+ /**
95
+ * The per-key queue every read and write of this disk waits in. Defaults to the disk's own
96
+ * `keyedQueue()`; a test passes one it also holds, to park a key deterministically.
97
+ */
98
+ readonly queue?: KeyedQueue | undefined;
88
99
  }
89
100
 
90
101
  /**
@@ -136,7 +147,7 @@ export function localDriver(options: LocalDriverOptions): StorageDriver {
136
147
  1,
137
148
  );
138
149
  const clock = options.clock ?? systemClock;
139
- const oneAtATime = keyedQueue();
150
+ const oneAtATime = options.queue ?? keyedQueue();
140
151
  // What `defineStorage` registered this driver as — the name a refusal's `disk('…')` must use.
141
152
  let registered = DRIVER_NAME;
142
153
  // The segment is the disk's REGISTERED name, learned from `defineStorage` at boot — the driver