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

Function streamHandler

packages/effect/src/unstable/cluster/Entity.ts:347–356  ·  view source on GitHub ↗
(envelope: any)

Source from the content-addressed store, hash-verified

345 resumes.set(envelope, resume)
346 })
347 const streamHandler = (envelope: any) =>
348 Effect.callback<any, any>((resume) => {
349 Queue.offerUnsafe(queue, envelope)
350 resumes.set(envelope, resume)
351 }).pipe(
352 Effect.map((streamOrQueue) =>
353 Stream.isStream(streamOrQueue) ? streamOrQueue : Stream.fromQueue(streamOrQueue)
354 ),
355 Stream.unwrap
356 )
357 const handlers: Record<string, any> = Object.create(null)
358 for (const rpc_ of this.protocol.requests.values()) {
359 const rpc = rpc_ as any as Rpc.AnyWithProps

Callers

nothing calls this directly

Calls 4

offerUnsafeMethod · 0.80
pipeMethod · 0.65
setMethod · 0.65
mapMethod · 0.45

Tested by

no test coverage detected