nationstates-0.1.0.2: NationStates API client

Safe HaskellSafe-Inferred
LanguageHaskell2010

NationStates.RateLimit

Description

Simple rate limiting combinator.

Synopsis

Documentation

newRateLimit :: TimeSpec -> IO RateLimit Source

Create a new rate limiter with the specified delay.

The rate limiter is thread-safe, and can be shared between threads.

rateLimit :: RateLimit -> IO a -> IO a Source

Run the given action, pausing as necessary to keep under the rate limit.