Class: Memory

tastypie/lib/throttle. Memory


new Memory( [options])

An in memory throttle implementation. For testing and debugging purposes only

Parameters:
Name Type Argument Description
options Object <optional>
Properties
Name Type Argument Default Description
at Number <optional>
150

The number of requests allowed during a timeframe before they should be throttled

timeframe Number <optional>
30000

The time frame in miliseconds to determine number of attempts before throttling

expires Number <optional>
<nullable>
null

time in ms after which to expire throttle records

Source:

Methods


convert(id)

creates a namespaced key based on an id

Parameters:
Name Type Description
id String

the internal key to record

Source:
Returns:

key

Type
String

incr(id)

Records an entry for a given keyf

Parameters:
Name Type Description
id String

the internal key to record

Source:

toThrottle(id)

Checks if a given key has reached the configured throttling limit

Parameters:
Name Type Description
id String

the internal key to record

Source:
Returns:
Type
Boolean