Download the PHP package imliam/laravel-throttle-simultaneous-requests without Composer

On this page you can find all versions of the php package imliam/laravel-throttle-simultaneous-requests. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-throttle-simultaneous-requests

Laravel Throttle Simultaneous Requests Middleware

Latest Version on Packagist Total Downloads

Throttle the current user's requests based on how many requests are currently being executed, in case any are time consuming before giving a response.

This helps when some endpoints are more resource-intensive than others, and stops users from retrying requests that may not have even completed yet.

This forces users of your API to interact in a different way by queuing their requests appropriately instead of spamming until they reach the request limit.

When performing an action only the current user can perform, this also helps to ensure that the endpoint has a form of idempotency and any side effects can only occur once until a subsequent request is made.

Installation

You can install the package with Composer using the following command:

Once installed to your project, add the middleware to your App\Http\Kernel::$routeMiddleware array.

Usage

You can use the middleware like any other. For example, to limit a particular endpoint to only 3 concurrent requests by the same user:

Why not use queues?

Queues have their place to defer time consuming tasks to a later date, however they are not always the most appropriate solution for a task. A given task could require use of limited hardware resources, or require some other kind of processing that does not make sense to run concurrently.

See how Stripe use concurrent request limiters...

Why is no Retry-After header sent?

Most typical rate limiting solutions limit a user to a number of requests within a set time period, such as 100 requests per minute, so include a Retry-After header to let the requestor know when they are available to try again.

This middleware does not add such a header to the response, due to the nature of the request taking a longer amount of time to complete there is no guaranteed time where the requestor can retry the request. Instead, it is up to the requestor to determine when to retry.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-throttle-simultaneous-requests with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3
illuminate/http Version ^7.0|^8.0
illuminate/support Version ^7.0|^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package imliam/laravel-throttle-simultaneous-requests contains the following files

Loading the files please wait ....