- type CPool = Pool Cassandra Server
- type Server = (HostName, PortID)
- defServer :: Server
- defServers :: [Server]
- type KeySpace = String
- data Cassandra = Cassandra {}
- createCassandraPool :: [Server] -> Int -> NominalDiffTime -> KeySpace -> IO CPool
- newtype Pool a s = Pool {}
- withPool :: Pool a s -> (a -> IO b) -> IO b
- data Ring a = Ring {}
- next :: Ring a -> Ring a
- data Stripe a s = Stripe {}
- createStripe :: (s -> IO a) -> (a -> IO ()) -> Int -> NominalDiffTime -> s -> IO (Stripe a s)
- withStripe :: Stripe a s -> (a -> IO b) -> IO b
- data Connection a = Connection {}
- modifyTVar_ :: TVar a -> (a -> a) -> STM ()
- modError :: String -> String -> a
Documentation
defServers :: [Server]Source
A single localhost server with default configuration
:: [Server] | List of servers to connect to |
-> Int | Max connections per server (n) |
-> NominalDiffTime | Kill each connection after this many seconds |
-> KeySpace | Each pool operates on a single KeySpace |
-> IO CPool |
Create a pool of connections to a cluster of Cassandra boxes
Each box in the cluster will get up to n connections. The pool will send queries in round-robin fashion to balance load on each box in the cluster.
createStripe :: (s -> IO a) -> (a -> IO ()) -> Int -> NominalDiffTime -> s -> IO (Stripe a s)Source
withStripe :: Stripe a s -> (a -> IO b) -> IO bSource
data Connection a Source
modifyTVar_ :: TVar a -> (a -> a) -> STM ()Source