Problem
Cmd::Effect uses OnExecute = (&Scheduler) -> Unit. Once an async or callback-based effect starts, the runtime has no cancellation or cleanup hook tied to the originating cell.
If the cell is detached or the application stops caring about the result, the effect may continue running and enqueue a stale message later.
Expected
Allow an effect to provide an optional cleanup/cancel callback that the runtime invokes when its owning cell is detached or the application is disposed. Existing fire-and-forget effects can keep returning no cleanup.
Problem
Cmd::EffectusesOnExecute = (&Scheduler) -> Unit. Once an async or callback-based effect starts, the runtime has no cancellation or cleanup hook tied to the originating cell.If the cell is detached or the application stops caring about the result, the effect may continue running and enqueue a stale message later.
Expected
Allow an effect to provide an optional cleanup/cancel callback that the runtime invokes when its owning cell is detached or the application is disposed. Existing fire-and-forget effects can keep returning no cleanup.