| 1 | # Engine run completion |
| 2 | |
| 3 | `EngineHandle::wait_run_completion` observes the particular background run |
| 4 | created by either engine spawn factory. `NormalReturn` means that run returned |
| 5 | and its owned future was dropped. `AbnormalTermination` covers panic, |
| 6 | run cancellation, or loss of the observation sender without a terminal value. |
| 7 | Handles constructed directly with `Engine::new` return `NotObserved`. |
| 8 | |
| 9 | Each waiter receives the same terminal value. Cancelling one wait neither stops |
| 10 | the engine nor consumes another waiter's result. Waiting does not initiate |
| 11 | shutdown; callers must use the existing shutdown protocol. The observation |
| 12 | does not keep another engine or operation-mailbox sender alive. |
| 13 | |
| 14 | The one-shot exec consumer shares its existing two-second absolute deadline |
| 15 | between sending `Shutdown` and waiting for completion after the event loop. |
| 16 | An unconfirmed normal return produces a warning without changing the task's |
| 17 | result. Existing early error returns and broken-pipe process exits do not pass |
| 18 | through this cleanup. The deadline bounds cooperative asynchronous waits; it |
| 19 | cannot preempt a blocking poll or destructor. |
| 20 | |
| 21 | Completion does not certify durable persistence, successful work, or termination |
| 22 | of detached children, blocking writers, event forwarders, or the supervisor's |
| 23 | later diagnostics. |
| 24 |