swift-async-algorithms
swift-async-algorithms copied to clipboard
Convert the guides for debounce and throttle into a proposal
This proposal formalizes rate limiting algorithms for debouncing and throttling.
Read the full proposal here
@phausler Debounce ought to implementable be without requiring the iterator to be Sendable. Have we looked into this?
It definitely is very weird/suspicious how many iterators (so, equivalents of a "subscription" intended for a single consumer) are becoming Sendable in this library 🤔
Hi
there was an issue regarding denouncing https://github.com/apple/swift-async-algorithms/issues/174 should not we take a look beforehand ?
@FranzBusch the Sendable requirement definitely complicates the code considerably (again I think falls into the "this package should do it so other folks shouldn't" category). I am working on a version that reduces the task creation overhead and the sendable requirement to iterators.... but it makes the merge PR look simple in comparison... Sendable should be something part of the review.
@twittemb Good call, I think half of that report is resolved now due to fixes in clock, I have not yet had a chance to verify other parts of it. The behavior should not be a full predication on reviewing this however.
@FranzBusch the Sendable requirement definitely complicates the code considerably (again I think falls into the "this package should do it so other folks shouldn't" category). I am working on a version that reduces the task creation overhead and the sendable requirement to iterators.... but it makes the merge PR look simple in comparison... Sendable should be something part of the review.
I am with you that it complicates things but we really should fix this since it has significant usability downsides. Like you said "let's get it right once in this package". Happy to help with this!
@swift-ci please test