swift-async-algorithms icon indicating copy to clipboard operation
swift-async-algorithms copied to clipboard

Convert the guides for debounce and throttle into a proposal

Open phausler opened this issue 3 years ago • 6 comments

This proposal formalizes rate limiting algorithms for debouncing and throttling.

Read the full proposal here

phausler avatar Sep 07 '22 22:09 phausler

@phausler Debounce ought to implementable be without requiring the iterator to be Sendable. Have we looked into this?

FranzBusch avatar Sep 08 '22 06:09 FranzBusch

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 🤔

ktoso avatar Sep 08 '22 07:09 ktoso

Hi

there was an issue regarding denouncing https://github.com/apple/swift-async-algorithms/issues/174 should not we take a look beforehand ?

twittemb avatar Sep 08 '22 07:09 twittemb

@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.

phausler avatar Sep 08 '22 19:09 phausler

@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!

FranzBusch avatar Sep 08 '22 19:09 FranzBusch

@swift-ci please test

phausler avatar Sep 21 '22 18:09 phausler