| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Test.Robot.Connection
Contents
Description
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
conn <- connect
replicateM_ 500 $ do
runRobotWith conn $ tap _A
putStrLn "Ducks!"
runRobotWith :: Connection -> Robot a -> IO a Source
Run the robot using an existing connection.
connect :: IO Connection Source
Connect to the X11 server.