Skip to content

RpcMessage

32 exports Added in v1.0.0 Source

Request

Ack interface

Added in v1.0.0 Source

Signature

interface Ack {
  readonly _tag: "Ack";
  readonly requestId: RequestId;
}

AckEncoded interface

Added in v1.0.0 Source

Signature

interface AckEncoded {
  readonly _tag: "Ack";
  readonly requestId: string;
}

constEof

Added in v1.0.0 Source

Signature

declare const constEof: Eof;

constPing

Added in v1.0.0 Source

Signature

declare const constPing: Ping;

Eof interface

Added in v1.0.0 Source

Signature

interface Eof {
  readonly _tag: "Eof";
}

FromClient type

Added in v1.0.0 Source

Signature

type FromClient<A extends Rpc.Any> = Request<A> | Ack | Interrupt | Eof;

FromClientEncoded type

Added in v1.0.0 Source

Signature

type FromClientEncoded = RequestEncoded | AckEncoded | InterruptEncoded | Ping | Eof;

Interrupt interface

Added in v1.0.0 Source

Signature

interface Interrupt {
  readonly _tag: "Interrupt";
  readonly interruptors: readonly Array<FiberId>;
  readonly requestId: RequestId;
}

InterruptEncoded interface

Added in v1.0.0 Source

Signature

interface InterruptEncoded {
  readonly _tag: "Interrupt";
  readonly requestId: string;
}

Ping interface

Added in v1.0.0 Source

Signature

interface Ping {
  readonly _tag: "Ping";
}

Request interface

Added in v1.0.0 Source

Signature

interface Request<A extends Rpc.Any> {
  readonly _tag: "Request";
  readonly headers: Headers;
  readonly id: RequestId;
  readonly payload: Payload<A>;
  readonly sampled?: boolean;
  readonly spanId?: string;
  readonly tag: Tag<A>;
  readonly traceId?: string;
}

RequestEncoded interface

Added in v1.0.0 Source

Signature

interface RequestEncoded {
  readonly _tag: "Request";
  readonly headers: readonly Array<[string, string]>;
  readonly id: string;
  readonly payload: unknown;
  readonly sampled?: boolean;
  readonly spanId?: string;
  readonly tag: string;
  readonly traceId?: string;
}

RequestId

Added in v1.0.0 Source

Signature

declare const RequestId: (id: string | bigint) => RequestId;

RequestId type

Added in v1.0.0 Source

Signature

type RequestId = Branded<bigint, RequestIdTypeId>;

Signature

declare const RequestIdTypeId: unique symbol;

RequestIdTypeId type

Added in v1.0.0 Source

Signature

type RequestIdTypeId = typeof RequestIdTypeId;

Response

ClientEnd interface

Added in v1.0.0 Source

Signature

interface ClientEnd {
  readonly _tag: "ClientEnd";
  readonly clientId: number;
}

ClientProtocolError interface

Added in v1.0.0 Source

Signature

interface ClientProtocolError {
  readonly _tag: "ClientProtocolError";
  readonly error: RpcClientError;
}

constPong

Added in v1.0.0 Source

Signature

declare const constPong: Pong;

FromServer type

Added in v1.0.0 Source

Signature

type FromServer<A extends Rpc.Any> =
  | ResponseChunk<A>
  | ResponseExit<A>
  | ResponseDefect
  | ClientEnd;

FromServerEncoded type

Added in v1.0.0 Source

Signature

type FromServerEncoded =
  | ResponseChunkEncoded
  | ResponseExitEncoded
  | ResponseDefectEncoded
  | Pong
  | ClientProtocolError;

Pong interface

Added in v1.0.0 Source

Signature

interface Pong {
  readonly _tag: "Pong";
}

ResponseChunk interface

Added in v1.0.0 Source

Signature

interface ResponseChunk<A extends Rpc.Any> {
  readonly _tag: "Chunk";
  readonly clientId: number;
  readonly requestId: RequestId;
  readonly values: readonly [SuccessChunk<A>, SuccessChunk<A>];
}

ResponseChunkEncoded interface

Added in v1.0.0 Source

Signature

interface ResponseChunkEncoded {
  readonly _tag: "Chunk";
  readonly requestId: string;
  readonly values: readonly [unknown, unknown];
}

ResponseDefect interface

Added in v1.0.0 Source

Signature

interface ResponseDefect {
  readonly _tag: "Defect";
  readonly clientId: number;
  readonly defect: unknown;
}

Signature

declare const ResponseDefectEncoded: (input: unknown) => ResponseDefectEncoded;

ResponseDefectEncoded interface

Added in v1.0.0 Source

Signature

interface ResponseDefectEncoded {
  readonly _tag: "Defect";
  readonly defect: unknown;
}

ResponseExit interface

Added in v1.0.0 Source

Signature

interface ResponseExit<A extends Rpc.Any> {
  readonly _tag: "Exit";
  readonly clientId: number;
  readonly exit: Exit<A>;
  readonly requestId: RequestId;
}

ResponseExitEncoded interface

Added in v1.0.0 Source

Signature

interface ResponseExitEncoded {
  readonly _tag: "Exit";
  readonly exit: ExitEncoded<unknown, unknown, unknown>;
  readonly requestId: string;
}

ResponseId type

Added in v1.0.0 Source

Signature

type ResponseId = Branded<number, ResponseIdTypeId>;

Signature

declare const ResponseIdTypeId: unique symbol;

ResponseIdTypeId type

Added in v1.0.0 Source

Signature

type ResponseIdTypeId = typeof ResponseIdTypeId;