Effect CommunityEC
Effect Community2y ago
1 reply
bowzee

Correctness of Broadcasting Stream without maxLag

Is it a correct way of broadcasting a stream without maximumLag? Didn't i missed something?

Stream.fromSchedule(Schedule.spaced('1 second'))
    .pipe((stream) => Effect.gen(function* () {
            const pubsub = yield* Effect.acquireRelease(PubSub.unbounded<Take.Take<number>>(), (pubsub) => PubSub.shutdown(pubsub));
            yield* Effect.fork(Stream.runIntoPubSub(stream, pubsub));
            return Stream.flattenTake(Stream.fromPubSub(pubsub));
        }) )
Was this page helpful?