Debouncer
Runs only the last block submitted within a time window, discarding earlier ones.
Each submit replaces the pending block and restarts the window; when the window elapses with no newer submission, the pending block runs as a new child coroutine of scope. Failures of a block follow the scope's regular exception handling. A debouncer whose scope is cancelled stops permanently and ignores later submissions.
Thread safety: this class is safe for concurrent use from multiple coroutines and threads; submit and cancel funnel through a conflated Channel and never block.
Parameters
window
how long a submission must stay the newest one before it runs.
scope
the scope that hosts the internal worker and every execution.
Throws
if window is negative.