Skip to content
This repository was archived by the owner on Aug 24, 2019. It is now read-only.
This repository was archived by the owner on Aug 24, 2019. It is now read-only.

Adding block parameter to DebouncedLimiter.execute? #31

Description

@basememara

Great library btw, thanks for sharing this!

I was wondering what the thoughts were behind not providing a block parameter to the execute function of the DebouncedLimiter like TimedLimiter? I wanted to do something like this:

let refreshTimeline = DebouncedLimiter(limit: 5)

refreshTimeline.execute {
    // Do some work that only runs last block per 5 seconds.
}

I have extended this in my fork to do this, but wanted to get your thoughts before creating a PR in case there's something I'm missing: https://github.com/basememara/RateLimit/commit/763a1b60fdc5884b70540cbb1c58aff6874a68b9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions