const command = Command.make("geth", "--dev").pipe(
Command.start,
Effect.tap(() => console.log("started")),
Effect.fork
);
const programGeth = Effect.gen(function* (_) {
const fiber = yield* _(command);
yield* _(Effect.sleep(2000));
yield* _(Fiber.interrupt(fiber));
console.log("killed");
}).pipe(Effect.provide(NodeContext.layer));
Runtime.runMain(programGeth);
const command = Command.make("geth", "--dev").pipe(
Command.start,
Effect.tap(() => console.log("started")),
Effect.fork
);
const programGeth = Effect.gen(function* (_) {
const fiber = yield* _(command);
yield* _(Effect.sleep(2000));
yield* _(Fiber.interrupt(fiber));
console.log("killed");
}).pipe(Effect.provide(NodeContext.layer));
Runtime.runMain(programGeth);