pub fn spawn_rebuild_worker<F>(livereload: LiveReload, rebuild: F) -> TickSenderExpand description
Spawn the rebuild worker on a dedicated OS thread and return the
sender used to enqueue rebuild ticks. The watcher closure should
call tx.try_send(()) for every filesystem event burst — failed
sends (channel full) are intentional coalescing.
The closure runs synchronously on the worker thread, so it may use
blocking I/O freely. It returns Ok(()) on success or
Err(RebuildError) on failure; the worker prints the error’s terminal
rendering and broadcasts its plain message to connected browsers.
The returned TickSender does not need to be held to keep the
worker alive — the worker stops only when every clone of the
sender is dropped.