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. Ditto pauses further callbacks, but continues to apply changes to the local store. If multiple relevant changes occur while paused, Ditto does not queue a callback for each change. After this callback is invoked, Ditto calls the handler once with the latest result if that result differs from the last result delivered.

Implementors§

Source§

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