The type of messages transmitted to the server
The type of messages transmitted to the client
StreamHanlder view of the underlying streams from the perspective of the client - from this perspective, you will be able to listen for messages being sent to the client and be able to write messages "out" to the server
StreamHanlder view of the underlying streams from the perspective of the server - from this perspective, you will be able to listen for messages being sent to the server and be able to write messages "out" to the client
Underlying stream to the clietn - likely unnecessary to access
Underlying stream to the server - likely unnecessary to access
New duplex
const isTrueEndpoint = async ({server}}: Duplex<boolean, string>) => {
server.on("message", (b) => server.write(b ? "true" : "false"));
}
// Forward requests from otherEndpoint to endpoint, and forward responses back
const isEvenEndpoint = async (dup: Duplex<number, string>) =>
isTrueEndpoint(dup.map((n: number) => n % 2 === 0, (s) => s));
transformation for input message types
transformation for output message types
Generated using TypeDoc
A Duplex<In, Out> is the core type used for StreamEndpoint, and represents two streams - one going "in" to a server, and one going "out" to a client