Skip to main content

install_change_sink

Function install_change_sink 

Source
pub fn install_change_sink(f: impl Fn(&Change) + 'static) -> ChangeSinkId
Expand description

Install a standing consumer of every announced change (main thread). Where record_changes is scoped to one closure, a sink lives until removed; it is how a persistence container watches the stores it loaded. Sinks receive the same Change the recorder would. A sink may write stores re-entrantly. The pipeline nests: a write made from inside a sink completes its own announcement (sinks included) before the outer one resumes, which is how relation maintenance cascades a delete. But a sink that writes owns its own termination: nothing here bounds the recursion.