nationstates-0.3.0.1: NationStates API client

Safe HaskellSafe-Inferred
LanguageHaskell2010

NationStates.RateLimit

Description

Simple rate limiting combinator.

Synopsis

Documentation

newRateLimit Source

Arguments

:: Rational

Delay, in seconds

-> IO RateLimit 

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.