Safe Haskell | None |
---|
Functions for managing connections manually.
- runRobotWith :: Connection -> Robot a -> IO a
- connect :: IO Connection
Managing connections
runRobot
opens a new connection every time it is called. If you
call it too many times, it will exhaust the connection pool, causing
a "maximum number of clients reached" error.
This module lets you avoid this error by handling the connection manually.
Example:
main = do Just conn <-connect
replicateM_ 500 $ dorunRobotWith
conn $ tap _A putStrLn "Ducks!"
runRobotWith :: Connection -> Robot a -> IO aSource
Run the robot using an existing connection.
connect :: IO ConnectionSource
Connect to the X11 server.