SignalNext

Trait SignalNext 

Source
pub trait SignalNext
where Self: FnOnce() + 'static + Send,
{ }
Expand description

An alias for FnOnce() + 'static + Send. A callback that tells Ditto the observer’s handler is ready to receive another callback.

This is a mechanism for handling backpressure when updates arrive faster than the handler can process them. Until this callback is invoked, Ditto pauses further callbacks while continuing to apply changes to the local store. If multiple relevant changes occur while callbacks are paused, Ditto does not queue a callback for each change. After this callback is invoked, Ditto calls the handler at most once with the latest result, and only if that result differs from the last result delivered.

Implementors§

Source§

impl<__: ?Sized> SignalNext for __
where Self: FnOnce() + 'static + Send,