pub fn spawn(
bus: Arc<EventBus>,
registry: Arc<Mutex<PluginRegistry>>,
format_name: String,
) -> JoinHandle<Result<()>>Expand description
Spawn the subscriber task. Returns a join handle the orchestrator
awaits at shutdown so the BuildEnd event is fully drained.
format_name must already exist in registry.output_formatter_index
— scheduler::run validates this before emitting BuildStart, so
a missing entry here means we lost a race against a concurrent
registry mutation (impossible in single-run orchestration). We drop
events silently in that case and exit on BuildEnd.