use Arc;
use ErasedToken;
/// An external event to inject into the executor.
/// Signal sent to a running executor via the control channel.
///
/// Merges external events and lifecycle commands into a single enum,
/// avoiding separate channels or atomic flags. The executor's async loop
/// pattern-matches on these variants with O(1) overhead per iteration.
///
/// # Lifecycle signals
///
/// - [`Drain`](Self::Drain) — graceful shutdown per \[ENV-011\]: reject new events,
/// process already-queued events, complete in-flight actions, terminate at quiescence.
/// - [`Close`](Self::Close) — immediate shutdown per \[ENV-013\]: discard queued events,
/// complete in-flight actions, terminate.
///
/// Use [`ExecutorHandle`](crate::executor_handle::ExecutorHandle) for RAII-managed
/// lifecycle with automatic drain on drop.