Memco

Interface TimeoutOptions

A deadline for one call, in seconds.

Seconds, not milliseconds. That is the unit a caller thinks in, and the conversion to the epoch deadline grpc-js wants happens where the call is built. Passing one replaces the client's own default for that call and changes nothing else; the default is DEFAULT_TIMEOUT seconds unless the client was constructed with another.

It is one deadline for the whole call, fixed as the call starts. When the call first has to wait for a credential — the client's first token, or a new key once the current one has expired — the wait counts against it, and the RPC has what is left; with a valid credential in hand the RPC has all of it. MemoryOperations.startSession, MemoryOperations.resumeSession and MemoryOperations.importMemories, which make several RPCs, apply it to each of them.

When the deadline elapses the call fails with a MemcoTimeoutError, and nothing is retried in its place: the deadline is the caller's own, so another attempt past it could not help.

A value that is not a positive, finite number is refused with a MemcoConfigError before anything is sent, because neither end of the range is usefully silent: zero and below expire before the call leaves, and an infinite one sends no deadline at all, so the call never settles.

interface TimeoutOptions {
    timeout?: number;
}

Hierarchy (View Summary)

Index
timeout?: number

Seconds to wait for this call. Defaults to the client's own timeout.

On this page