The client
The lists change without asking you. A daemon, a socket, a subscription — something on the other end has opinions about when things happen.
bridge::stream is the shape for this: a producer on the tokio runtime, each item delivered to the UI thread as it arrives, and cancellation that needs no abort registry. When the view goes away the receiver drops, the producer's send starts failing, and it stops.
Coalesce. A compose up of twenty services emits hundreds of events in a second, and refetching per event hammers the daemon and thrashes the list. Bump an epoch signal instead and let the views refetch once.
What you are carrying
hostThe streaming facade, gpui-free.
atlas::bridge::streamMany items, one seam, implicit cancellation.
atlas::shell::NavThe rail over the routed views.
atlas::shell::ToastsOne severity vocabulary for what fails.
Start it
scripts/new.sh Acme ~/Dev/acme --template sidebar
What it looks like
bridge::stream(
cx,
move |tx| async move {
// A closed receiver means the view is gone; returning false stops us.
let _ = host.stream_events(|event| tx.unbounded_send(event).is_ok()).await;
},
move |_event, cx| state.bump(cx), // coalesce: bump an epoch, refetch once
|_| {},
);