MCPcopy Create free account
hub / github.com/effect-app/libs / fromChannel

Function fromChannel

repos/effect/packages/effect/src/Sink.ts:224–240  ·  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

222 * const channel = Channel.identity<readonly [number, ...Array<number>], never, void>().pipe(
223 * Channel.drain,
224 * Channel.mapDone(() => ["consumed"] as const)
225 * )
226 * const sink = Sink.fromChannel(channel)
227 *
228 * await Effect.runPromise(Stream.run(Stream.make(1, 2, 3), sink)) // => "consumed"
229 * ```
230 *
231 * @see {@link toChannel} for converting a `Sink` back to a `Channel`
232 * @category constructors
233 * @since 2.0.0
234 */
235export const fromChannel = <L, In, E, A, R>(
236 channel: Channel.Channel<
237 never,
238 E,
239 End<A, L>,
240 NonEmptyReadonlyArray<In>,
241 never,
242 void,
243 R

Callers 15

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
failSyncFunction · 0.70

Calls 2

fromTransformFunction · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…