Tests
All checks were successful
Lint / lint (push) Successful in 12s

This commit is contained in:
Julien Valverdé
2025-05-08 05:59:36 +02:00
parent 70e9b9218d
commit 6bc07d5b2a

View File

@@ -0,0 +1,17 @@
import { Effect, Exit, PubSub, Scope, Stream } from "effect"
await Effect.gen(function*() {
const scope = yield* Scope.make()
const pubsub = yield* PubSub.unbounded<string>()
console.log(yield* PubSub.isShutdown(pubsub))
const stream = yield* Stream.fromPubSub(pubsub, { scoped: true, shutdown: true }).pipe(
Effect.provideService(Scope.Scope, scope)
)
yield* Scope.close(scope, Exit.void)
console.log(yield* PubSub.isShutdown(pubsub))
}).pipe(
Effect.runPromise,
)