Stopping an Effect.runPromise Program with External Event

If I'm running a program with Effect.runPromise(program), and I want to be able to stop the whole program on some event from outside the effect runtime, how would I do that? Basically, instead of stopping on process exit, I want to stop on another event I receive that fires just before process exit.
Was this page helpful?