This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Tobias Lütke (author)
Thu May 01 15:04:03 -0700 2008
throttle /
| name | age | message | |
|---|---|---|---|
| |
README | Thu May 01 15:04:03 -0700 2008 | [Tobias Lütke] |
| |
lib/ | Thu May 01 15:03:04 -0700 2008 | [Tobias Lütke] |
README
Throttle arbituary operation. Once limit is reached it will raise a Throttle::LimitExeeded exception.
Example:
Throttle.for("feed:#{request.remote_ip}", :max => 20, :in => 10.minutes) do
render :xml => Articles.all
end
If you want to clear the timeout for the current block ( for example: fraud protection. Clear the throttle when
the submitted Credit Card was valid. ) your block can accept a yielded throttle object and call the clear method
Throttle.for("cc:#{request.remote_ip}", :max => 20, :in => 10.minutes) do |throttle|
if am.pay(@credit_card)
throttle.clear
redirect_to :action => 'done'
end
end



