MCPcopy Create free account
hub / github.com/Effect-TS/effect / duplex

Function duplex

packages/effect/src/unstable/encoding/Msgpack.ts:225–247  ·  view source on GitHub ↗
(
  self: Channel.Channel<
    Arr.NonEmptyReadonlyArray<Uint8Array<ArrayBuffer>>,
    OE,
    OutDone,
    Arr.NonEmptyReadonlyArray<Uint8Array<ArrayBuffer>>,
    IE | MsgPackError,
    InDone,
    R
  >
)

Source from the content-addressed store, hash-verified

223 * @since 4.0.0
224 */
225export const duplex = <R, IE, OE, OutDone, InDone>(
226 self: Channel.Channel<
227 Arr.NonEmptyReadonlyArray<Uint8Array<ArrayBuffer>>,
228 OE,
229 OutDone,
230 Arr.NonEmptyReadonlyArray<Uint8Array<ArrayBuffer>>,
231 IE | MsgPackError,
232 InDone,
233 R
234 >
235): Channel.Channel<
236 Arr.NonEmptyReadonlyArray<unknown>,
237 MsgPackError | OE,
238 OutDone,
239 Arr.NonEmptyReadonlyArray<unknown>,
240 IE,
241 InDone,
242 R
243> =>
244 encode<IE, InDone>().pipe(
245 Channel.pipeTo(self),
246 Channel.pipeTo(decode())
247 )
248
249/**
250 * Wraps a bidirectional byte channel with schema-aware MessagePack encoding and

Callers 2

Ndjson.tsFile · 0.85
Msgpack.tsFile · 0.85

Calls 3

encodeFunction · 0.70
decodeFunction · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected