pub enum RuntimeLane {
Legacy,
Structured,
Asupersync,
}Expand description
Runtime lane for the Asupersync migration rollout.
Controls which subscription/effect execution backend is active.
The default is Structured, reflecting the completed CancellationToken migration (bd-3tmu4).
§Migration rollout
Legacy— pre-migration thread-based subscriptions with manual stop coordinationStructured— CancellationToken-backed subscriptions (current default after bd-3tmu4)Asupersync— Asupersync blocking-task execution with structured subscriptions
Selection is logged at startup so operators can tell which lane is active.
Without asupersync-executor, requesting Asupersync falls back to Structured.
Executor initialization errors are returned to the caller.
Variants§
Legacy
Pre-migration behavior: thread-based subscriptions with manual stop coordination. This is the safe default that preserves all existing semantics.
Structured
Structured cancellation: subscriptions use CancellationToken internally. Externally observable behavior is identical to Legacy.
Asupersync
Execute tasks through the Asupersync blocking pool, retaining structured
subscription cancellation. Requires the asupersync-executor feature;
without it, falls back to Structured with a warning.
Implementations§
Source§impl RuntimeLane
impl RuntimeLane
Sourcepub const fn asupersync_available() -> bool
pub const fn asupersync_available() -> bool
Whether Self::Asupersync is backed by a real executor in this
build, rather than falling back to Self::Structured.
Exposed because a feature flag is invisible to downstream crates:
#[cfg(feature = "asupersync-executor")] in a crate that merely
depends on ftui-runtime tests that crate’s own features, not
these. Without this, such a crate can only hard-code one of the two
behaviours and be wrong in the other build - which is exactly what
ftui-harness’s runbook_step4_promote_to_enabled did.
Sourcepub fn resolve(self) -> Self
pub fn resolve(self) -> Self
Resolve the effective lane, applying fallback rules.
Asupersync is available when asupersync-executor is compiled in -
see Self::asupersync_available. Otherwise, its tasks use
Structured’s default executor.
Sourcepub fn uses_structured_cancellation(self) -> bool
pub fn uses_structured_cancellation(self) -> bool
Check if this lane uses structured cancellation (CancellationToken).
Sourcepub fn task_executor_backend(self) -> TaskExecutorBackend
pub fn task_executor_backend(self) -> TaskExecutorBackend
Resolve the default task executor backend for this lane.
§Input-lag regression fix (#78)
The Structured lane changes subscription cancellation semantics
(CancellationToken-backed stop signals in subscription.rs); it must
NOT also collapse Cmd::Task concurrency. Earlier this returned
EffectQueue, which routed every Cmd::Task through a single
effect_queue_loop worker thread with a Smith’s-rule (SPT) scheduler,
serializing all tasks. Apps that forward PTY output via per-pane
Cmd::task polling loops (e.g. 10ms drains) then contended for one
serialized worker, adding per-keystroke head-of-line latency versus
v0.2.1, where each Cmd::task got its own std::thread::spawn.
Structured cancellation does not depend on the effect queue (stop
signals are token-backed regardless of executor backend), so the two
concerns are decoupled here: Structured keeps the structured
cancellation semantics but restores per-task-thread (Spawned)
execution. Apps that explicitly opt into EffectQueue still get it
(the lane default only applies when the app uses the legacy default
backend — see EffectQueueConfig::uses_legacy_default_backend).