RefCountedOptions
Defined in: packages/core/src/adapters/remote-pool.ts:16
Options of refCounted.
Type Parameters
Section titled “Type Parameters”TResource
Section titled “TResource”TResource
Properties
Section titled “Properties”close: (
resource) =>void|Promise<void>
Defined in: packages/core/src/adapters/remote-pool.ts:26
Stop the resource (suspend the computer).
Parameters
Section titled “Parameters”resource
Section titled “resource”TResource
Returns
Section titled “Returns”void | Promise<void>
closeTimeoutMs?
Section titled “closeTimeoutMs?”
optionalcloseTimeoutMs?:number
Defined in: packages/core/src/adapters/remote-pool.ts:34
How long close may take in ms before it counts as failed (default 30 000).
idleMs
Section titled “idleMs”idleMs:
number
Defined in: packages/core/src/adapters/remote-pool.ts:32
How long the resource stays open with no connection, in ms. Required: set it longer than the gap between a build’s passes (the extract and tests pre-passes and its shards connect close together), for example 120 000.
logger?
Section titled “logger?”
optionallogger?:Logger
Defined in: packages/core/src/adapters/remote-pool.ts:36
Where close failures go (error class only, never the message).
open: (
context,signal) =>Promise<TResource>
Defined in: packages/core/src/adapters/remote-pool.ts:24
Start the resource (wake the computer) and return what connections need of it. Called by the
first connection; concurrent first connections share the call. Must be idempotent: it runs
again after a failed close, and may overlap a close that timed out. signal aborts when
every waiting connection was cancelled, and at shutdown: clean up after yourself when it does,
or throw an error with a resource property so the pool closes it.
Parameters
Section titled “Parameters”context
Section titled “context”signal
Section titled “signal”AbortSignal
Returns
Section titled “Returns”Promise<TResource>
schedule?
Section titled “schedule?”
optionalschedule?: (run,ms) => () =>void
Defined in: packages/core/src/adapters/remote-pool.ts:41
Runs run after ms and returns what cancels it (default: an unref’d setTimeout). A seam
for tests to drive the idle timer without real time.
Parameters
Section titled “Parameters”() => void
number
Returns
Section titled “Returns”() => void