import { Effect, Fiber } from "effect"
const sleepAndLog = Effect.gen(function*(_) {
yield* Effect.sleep("100 millis");
yield* Effect.logInfo("hi");
}).pipe(Effect.uninterruptible);
Effect.gen(function* () {
const fiber = yield* Effect.fork(sleepAndLog);
yield* Fiber.interrupt(fiber)
yield* Fiber.await(fiber); // not working
// we want to see "hi"
}).pipe(Effect.runPromise)
import { Effect, Fiber } from "effect"
const sleepAndLog = Effect.gen(function*(_) {
yield* Effect.sleep("100 millis");
yield* Effect.logInfo("hi");
}).pipe(Effect.uninterruptible);
Effect.gen(function* () {
const fiber = yield* Effect.fork(sleepAndLog);
yield* Fiber.interrupt(fiber)
yield* Fiber.await(fiber); // not working
// we want to see "hi"
}).pipe(Effect.runPromise)