Open
Description
Currently, the new delivery_time is calculated as:
crossbeam/crossbeam-channel/src/flavors/tick.rs
Lines 47 to 50 in dfafb46
But it can be a flavor config like Java's ScheduledExecutorService
: scheduleAtFixedRate
and scheduleWithFixedDelay
.
The current flavor is in scheduleWithFixedDelay
, while replace now + self.duration
with delivery_time + self.duration
can simulate scheduleAtFixedRate
as much as possible.
To consume multiple ticks backlog, one can use try_iter
and then collect
.
Let me know if it's a good idea to follow. cc @taiki-e