net.dontdrinkandroot.lastfm.api.ws

## Class FetchLimitEnforcer

- java.lang.Object
- - net.dontdrinkandroot.lastfm.api.ws.FetchLimitEnforcer

    public class FetchLimitEnforcer
    extends Object

Enforce last.fm fetch limit. "You will not make more than 5 requests per originating IP address per second, averaged over a 5 minute period".

Author:
  Philip W. Sorst <philip@sorst.net>

### Constructor Summary

Constructors
Constructor and Description
`FetchLimitEnforcer()`

### Method Summary

Methods
`double` `getWebRequestsPerSecond()` Get the number of requests per second in the compliance interval.
`void` `waitForTimeslot()` Block as long as it is necessary to comply with the request/second limit.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### FetchLimitEnforcer

    public FetchLimitEnforcer()

### Method Detail

#### getWebRequestsPerSecond

    public final double getWebRequestsPerSecond()

Get the number of requests per second in the compliance interval.

Returns:
  Number of requests per second.

#### waitForTimeslot

    public final void waitForTimeslot()

Block as long as it is necessary to comply with the request/second limit.