effect-io-ai

Package: @effect/platform-node-shared
Module: NodeSocket

NodeSocket.fromDuplex

Adapts a Node Duplex into a Socket.Socket, wiring data events to socket handlers, providing a scoped writer, and mapping open, read, write, and close failures to SocketError.

Signature

declare const fromDuplex: <RO>(open: Effect.Effect<Duplex, Socket.SocketError, RO>, options?: { readonly openTimeout?: Duration.Input | undefined; }) => Effect.Effect<Socket.Socket, never, Exclude<RO, Scope.Scope>>

Source

Since v4.0.0