Interface RPCStream<R, W, M>

This interface extends the ReadableWritablePair with a method to cancel the connection. It also includes some optional generic metadata. This is mainly used as the return type for the StreamFactory. But the interface can be propagated across the RPC system.

Type Parameters

Hierarchy

  • ReadableWritablePair<R, W>
    • RPCStream

Properties

cancel: ((reason?) => void)

Type declaration

    • (reason?): void
    • Parameters

      • Optional reason: any

      Returns void

meta?: M
readable: ReadableStream<R>
writable: WritableStream<W>

Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.

Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.

Generated using TypeDoc