docs(architecture): clarify storage pass-through mode

This commit is contained in:
mesalogo
2026-10-07 21:26:40 +08:00
parent 13c29badfb
commit c465d39d58
3 changed files with 15 additions and 1 deletions
+8 -1
View File
@@ -43,7 +43,11 @@ type Waiting = { start: () => void; cancel: () => void; fail: (error: Error) =>
export type QueryTransport = Pick<EventEmitter, 'on' | 'once'> & Pick<Worker, 'postMessage' | 'ref' | 'unref' | 'terminate'>
export interface QueryTransportOptions {
createTransport: () => QueryTransport
/** Optional test or caller policy; production storage leaves this unset. */
/**
* Optional caller policy. Production desktop storage leaves this unset so
* requests pass through to the storage host; the waiting queue is only for
* explicit bounded readers and tests.
*/
maxPending?: number
}
@@ -83,6 +87,9 @@ export class ReadonlyQueryReader {
private readonly transportOptions?: QueryTransportOptions
) {}
// This class correlates requests for both read workers and storage. The
// storage client intentionally uses the unbounded pass-through mode; it does
// not create a second storage owner or impose a product capacity limit.
private get maxPending(): number { return this.transportOptions?.maxPending ?? DEFAULT_MAX_PENDING }
/** False while backing off after a crash or startup failure. */