effect-io-ai

Package: effect
Module: Channel

Channel.suspend

Creates a Channel that lazily evaluates to another channel.

Example (Suspending channel creation)

import { Channel } from "effect"

const channel = Channel.suspend(() => Channel.succeed(42))
// The inner channel is not created until the suspended channel is run

Signature

declare const suspend: <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(evaluate: LazyArg<Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>>) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>

Source

Since v2.0.0