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

Function suspend

packages/effect/src/Stream.ts:875–879  ·  view source on GitHub ↗
(stream: LazyArg<Stream<A, E, R>>)

Source from the content-addressed store, hash-verified

873 * @since 2.0.0
874 */
875export const suspend = <A, E, R>(stream: LazyArg<Stream<A, E, R>>): Stream<A, E, R> => {
876 const suspended = fromChannel(Channel.suspend(() => stream().channel))
877 suspendedStreams.set(suspended, stream)
878 return suspended
879}
880
881const suspendedStreams = new WeakMap<Stream<any, any, any>, LazyArg<Stream<any, any, any>>>()
882

Callers 1

Stream.tsFile · 0.70

Calls 3

fromChannelFunction · 0.70
streamFunction · 0.70
setMethod · 0.65

Tested by

no test coverage detected