hamburgscleanest / laravel-guzzle-throttle Goto Github PK
View Code? Open in Web Editor NEWA Laravel wrapper for https://github.com/hamburgscleanest/guzzle-advanced-throttle.
License: MIT License
A Laravel wrapper for https://github.com/hamburgscleanest/guzzle-advanced-throttle.
License: MIT License
Hey, nice work. I made something similar recently. My throttle is fine, but I've got issues with funnel. It works fine in homestead but not in my vapor deploy. Something about "All keys do not map to the same slot" from redis cluster. Have you taken a crack at funnel?
Packages is locked toPHP version >= 7.1.0
Provide a detailed description of the change or addition you are proposing.
Make it clear if the issue is a bug, an enhancement or just a question.
Me because i want to support >= 7.0
How can it benefit other users?
Others who who also want to support >= won't be able to use this package.
Is there any specific reason why this is locked to >= 7.1.0, if none, then maybe lower to 7.0
Include as many relevant details about the environment you experienced the bug in and how to reproduce it.
Describe the bug
I was trying to add throttle to a Http request using headers, but it looks like the standard methods are not recognized.
To Reproduce
This is my code
/**
* Generate API Http client request
*
* @param string $host The API host
* @param string $url The API URL
* @param array $params The API query URL arguments
* @return PromiseInterface|Response
*/
public function get(string $host, string $url, array $params)
{
$scheme = str_starts_with('https://', $host) ? $host : 'https://' . $host;
$relativeUrl = str_replace($scheme, '', $url);
$client = LaravelGuzzleThrottle::client(['base_uri' => $scheme]);
return $client
->acceptJson()
->withHeaders(
[
'x-rapidapi-host' => $host,
'x-rapidapi-key' => $this->key,
]
)
->timeout(20)->retry(1, 100, function ($exception)
{
// retry once after a 20 seconds cURL timeout, delayed by 100ms
return $exception instanceof ConnectException;
})
->get($relativeUrl, $params);
}
Is there any way to use other mathods than get
?
Thx.
hamburgscleanest/guzzle-advanced-throttle#12
From the configuration file laravel-guzzle-throttle.php the driver is set to default as standard, however the default driver set by CACHE_DRIVER in the .env file was ignored and it rises a hamburgscleanest\GuzzleAdvancedThrottle\Exceptions\RedisDatabaseNotSetException.
Everything works correctly if I set the driver value to env('CACHE_DRIVER') instead of 'default'.
It would be great to update this package to support L9.
Hi,
First of all thanks for this great package! Works perfectly :)
Not so much of an issue, but a few remarks regarding the documentation:
php artisan config:clear
if the config is cached. Without this, you will encounter errors from this package. I got a 'Please provide a cache driver' error, even though it was set correctly. Maybe a good idea to mention this in the documentation :)Cheers! Sacha
Remove support Laravel 5.5 in documents
In composer.json
file:
"require": {
"php": ">=7.1.0",
"hamburgscleanest/guzzle-advanced-throttle": "1.*",
"illuminate/support": "5.6.*"
},
This package required "illuminate/support": "5.6.*"
, it only available in Laravel 5.6.*
But in this package's README, it have configure for Laravel < 5.5
I think you should update README
To support the new features of Guzzle Advanced Throttle v2.0.0, we need to update the composer file and also update the README.
The new config structure will be a breaking change.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.