2.0.0 • Published 4 years ago

@tracerbench/protocol-transport v2.0.0

Weekly downloads
530
License
BSD-2-Clause
Repository
-
Last release
4 years ago

@tracerbench/protocol-transport

Adapts a AttachMessageTransport function defined in @tracerbench/message-transport into an AttachProtocolTransport<SessionId> function which is used to create a send function.

export type AttachProtocolTransport<SessionId> = (
  onEvent: OnEvent,
  onError: OnError,
  onClose: OnClose,
) => [
  AttachSession<SessionId>,
  DetachSession<SessionId>,
  SendMethod<SessionId>,
  RaceCancellation
];

export type AttachSession<SessionId> = (
  sessionId: SessionId,
) => AttachProtocolTransport<SessionId>;

export type DetachSession<SessionId> = (sessionId: SessionId) => void;

export type SendMethod<SessionId> = <
  Method extends string,
  Params extends object,
  Result extends object
>(
  method: Method,
  params?: Params,
  raceCancellation?: RaceCancellation,
) => Promise<Result>;
2.0.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

1.0.0-beta.2

5 years ago

1.0.0-beta.1

5 years ago