A simple round-robin data type

Latest on Hackage:

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

MIT licensed by winterland1989

Hackage Travis-CI

A simple round-robin data type

This package provide a simple data type wrap a round-robin table. so you can select resources(host, connection...) using round-robin fashion.


import qualified Date.RoundRobin as RR
import qualified Network.HTTP.Client as HTTP

main :: IO ()
main = do
    reqs <- mapM HTTP.parseUrl ["", "", ""]
    proxyTable <- RR.newRoundRobin reqs
    manager <- HTTP.newManager HTTP.defaultManagerSettings

    -- maybe now you're inside a server service(a forked thread)
    -- use select to choose a request in round-robin fashion
        req <- proxyTable
        res <- HTTP.httpLbs req manager
Depends on 2 packages:
Used by 1 package:
comments powered byDisqus