Crate periodic_closure

Crate periodic_closure 

Source

Structs§

PeriodicClosure
The struct implements an abstraction for running periodically a closure at fixed period - ‘P’. The first call happens after duration of ‘P’ when ‘start’ is called. If the closure runs longer than the period then consequtive calls to the closure will be collapsed guaranteeing that we don’t call the closure more than once for any interval of duration ‘P’. The closure is stopped when the object is dropped.