Add source-level debounce and throttle wrappers
- Dominant language
- Rust
- Stars
- 9
- Forks
- 1
- Avg merge
- 11h 46m
- Merged PRs (30d)
- 62
Description
## Summary
Add reusable source-level debounce and throttle wrappers for subscriptions.
High-frequency sources currently need application-specific coalescing. Runtime load control bounds memory and batch work, but it is not a substitute for reducing redundant input at the source. The time model is now settled: use Tokio's executor clock and paused time for deterministic tests rather than introducing a public clock abstraction.
## Required semantics
Before exposing the API, define:
- leading and trailing behavior;
- what value is retained when several inputs arrive in one window;
- subscription identity and restart behavior;
- cancellation, scope teardown, and shutdown behavior;
- behavior when the upstream source finishes;
- mapping and composition behavior.
The wrappers should be additive stream/source transformations. They must not change kernel batching, data-lane ordering, or backpressure contracts.
## Acceptance criteria
- [ ] Public source/subscription wrappers provide debounce and throttle behavior with documented semantics.
- [ ] Existing subscription identity remains structural and stable.
- [ ] Paused-time tests cover window boundaries, bursts, upstream completion, cancellation, and restart.
- [ ] Tests cover mapping and reducer composition.
- [ ] Documentation distinguishes source-side coalescing from `batch_max_messages` and data-lane capacity.
Contributor guide
Assessment
This issue has not been assessed yet.