Skip to content

[FEATURE] Implement a rate-limiter for API calls #119

@Moongazer

Description

@Moongazer

Not sure if this should be a feature inside this library, or if a rate-limit is more a task for the custom API-client implementation. We've implemented the rate-limit using symfony/rate-limiter with token-bucket limiter which works amazing. Little downside is, that our API-service needs to implement the logic right before each API request (e.g. $this->api->voucher()->create($data);). So it's a bit of repeating-code always adding the check before each API request.

Because the LexOffice API introduces the rate-limit for everyone, maybe it makes sense to have it implemented inside this library (including configuration options in case there will be different limits for different plans in the future, or to disable it entirely). We think a good place would be in Api::getResponse(), right before $this->client->send($this->request)?!

Any feedback appreciated.

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