@prismshadow/penguin-library-machine · library/machine/src/session-forward.ts:263

MachineSessionForward

interface

MachineSessionForward: what the machines module provides for the forward route below.

API

@Interface("@prismshadow/penguin-server#MachineSessionForward")
export abstract class MachineSessionForward {
  abstract forward(
      request: Request,
      sessionId: string,
      projectIds: readonly string[],
      caller?: Omit<HistoryCaller, "projectId">,
    ): Promise<Response | null>;
}

Contract Topology

Static AST wiring across @Module / @Provide / @Use
@Provideprovided by
@Useconsumed by (1)

Members (1)

forward

forward(request: Request, sessionId: string, projectIds: readonly string[], caller?: Omit<HistoryCaller, "projectId">): Promise<Response | null>

Forwards request to the machine that holds sessionId, looking among the machines of projectIds (the Projects the caller can open) when the index does not know it yet. Null when every machine asked answered that it holds no such Session (the local routes then say session_not_found); 503 machine_no_answer when some that could hold it did not answer; otherwise the machine's answer, or this server's own reason why there is none.

@paramrequestRequest
@paramsessionIdstring
@paramprojectIdsreadonly string[]
@paramcaller?Omit<HistoryCaller, "projectId">
@returnsPromise<Response | null>