const intervalStream = Stream.fromSchedule(Schedule.spaced('500 millis'))
.pipe(Stream.tap(Console.log));
const program = Effect.gen(function* () {
const pubsub = yield* PubSub.unbounded<Take.Take<number>>();
yield* Effect.fork(Stream.runIntoPubSubScoped(intervalStream, pubsub));
})
NodeRuntime.runMain(Effect.awaitAllChildren(Effect.scoped(program)))
const intervalStream = Stream.fromSchedule(Schedule.spaced('500 millis'))
.pipe(Stream.tap(Console.log));
const program = Effect.gen(function* () {
const pubsub = yield* PubSub.unbounded<Take.Take<number>>();
yield* Effect.fork(Stream.runIntoPubSubScoped(intervalStream, pubsub));
})
NodeRuntime.runMain(Effect.awaitAllChildren(Effect.scoped(program)))