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

Function fromChannel

packages/effect/src/Sink.ts:244–260  ·  view source on GitHub ↗
(
  channel: Channel.Channel<
    never,
    E,
    End<A, L>,
    NonEmptyReadonlyArray<In>,
    never,
    void,
    R
  >
)

Source from the content-addressed store, hash-verified

242 * @since 2.0.0
243 */
244export const fromChannel = <L, In, E, A, R>(
245 channel: Channel.Channel<
246 never,
247 E,
248 End<A, L>,
249 NonEmptyReadonlyArray<In>,
250 never,
251 void,
252 R
253 >
254): Sink<A, In, L, E, R> =>
255 fromTransform((upstream, scope) =>
256 Channel.toTransform(channel)(upstream, scope).pipe(
257 Effect.flatMap(Effect.forever({ disableYield: true })),
258 Pull.catchDone(Effect.succeed)
259 ) as Effect.Effect<End<A, L>, E, R>
260 )
261
262/**
263 * Creates a sink that writes its input to a Web `WritableStream`.

Callers 15

fromWritableStreamFunction · 0.70
unwrapFunction · 0.70
fromEffectFunction · 0.70
fromPullFunction · 0.70
transformPullFunction · 0.70
transformPullBracketFunction · 0.70
callbackFunction · 0.70
Stream.tsFile · 0.70
succeedFunction · 0.70
syncFunction · 0.70
suspendFunction · 0.70
failFunction · 0.70

Calls 2

fromTransformFunction · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected