Download the PHP package davedevelopment/stiphle without Composer
On this page you can find all versions of the php package davedevelopment/stiphle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download davedevelopment/stiphle
More information about davedevelopment/stiphle
Files in davedevelopment/stiphle
Package stiphle
Short Description Simple rate limiting/throttling for php
License MIT
Homepage http://github.com/davedevelopment/stiphle
Informations about the package stiphle
Stiphle
Install via Composer
What is it?
Stiphle is a little library to try and provide an easy way of throttling/rate limit requests, for those without fancy hardware etc.
How does it work?
You create a throttle, and ask it how long you should wait. For example, given that $identifier is some means of identifying whatever it is you're throttling, and you want to throttle it to 5 requests per second:
Use combinations of values to provide bursting etc, though use carefully as it screws with your mind
Throttle Strategies
There are currently two types of throttles, Leaky Bucket and a simple fixed time window.
NB: The current implementation of the TimeWindow
throttle will only work on 64-bit architectures!
Storage
Stiphle currently ships with 5 storage engines
- In process
- APC
- Memcached
- Doctrine Cache
- Redis
Stiphle uses the in process storage by default. A different storage engine can be injected after object creation.
Todo
- More Tests!
- Decent Unit tests
- More throttling methods
- More storage adapters, the current ones are a little volatile, Mongo, Cassandra, MemcacheDB etc
Copyright
Copyright (c) 2011 Dave Marshall. See LICENCE for further details