Commit graph parsimony/internal/queue/pacer_test.go
Author SHA1 Message Date
tgiachi
c853ae7e61 test(queue): cover a pacer slot given up while a later caller holds its own
- a caller that gives up must not release a slot when another caller reserved after it
- a delivery that did not get its slot is not counted in the run's stats
2026-11-10 12:55:26 +01:00
tgiachi
b125c61fcf feat(queue): a pacer that spaces outgoing sends
- newPacer(perSecond, now, sleep): strictly spaced slots, no burst, safe for concurrent callers
- Wait reserves the next slot under a mutex and sleeps outside it
- a cancelled caller gives its slot back when it is the last one; a cancelled context returns at once
- a rate that is zero, negative, NaN or infinite means no pacer; a very low rate is capped at one interval of a year
- tests with an injected clock and sleep
2026-11-10 12:37:15 +01:00