Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion - a very small code change would implement rate limiting #968

Open
globalvisionmedia opened this issue Sep 1, 2022 · 0 comments

Comments

@globalvisionmedia
Copy link
Contributor

a lot of APIs have rate limiting but...

If you were to add:
$client_options = ['timeout', 'proxy', 'handler'];

then we could use this: composer require spatie/guzzle-rate-limiter-middleware and write apps that include (for example)

$stack = HandlerStack::create();
$stack->push(RateLimiterMiddleware::perSecond(8));

$provider = new Provider([
'clientId' => MYOB_CLIENT_ID,
'clientSecret' => MYOB_CLIENT_SECRET,
'redirectUri' => CALLBACK_URI,
'username' => USERNAME,
'password' => PASSWORD,
'scopes' => ['CompanyFile'],
'handler' => $stack
]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants