-- | A pool of plain MongoDB pipes.
-- The database parameter has not yet been applied yet.
-- This is useful for switching between databases (on the same host and port)
-- Unlike the normal pool, no authentication is available
createMongoDBPipePool :: (Trans.MonadIO m, Applicative m) => HostName -> PortID
                  -> Int -- ^ pool size (number of stripes)
                  -> Int -- ^ stripe size (number of connections per stripe)
                  -> NominalDiffTime -- ^ time a connection is left idle before closing
                  -> m PipePool
createMongoDBPipePool hostname port connectionPoolSize stripeSize connectionIdleTime =
  Trans.liftIO $ Pool.createPool
                          (createPipe hostname port)
                          DB.close
                          connectionPoolSize
                          connectionIdleTime
                          stripeSize
createMongoDBPipePool :: (Trans.MonadIO m, Applicative m) => HostName -> PortID
                  -> Int -- ^ pool size (number of stripes)
                  -> Int -- ^ stripe size (number of connections per stripe)
                  -> NominalDiffTime -- ^ time a connection is left idle before closing
                  -> m PipePool
createMongoDBPipePool hostname port connectionPoolSize stripeSize connectionIdleTime =
  Trans.liftIO $ Pool.createPool
                          (createPipe hostname port)
                          DB.close
                          connectionPoolSize
                          connectionIdleTime
                          stripeSize
createMongoDBPipePool hostname port connectionPoolSize stripeSize connectionIdleTime =
  Trans.liftIO $ Pool.createPool
                          (createPipe hostname port)
                          DB.close
                          connectionPoolSize
                          connectionIdleTime
                          stripeSize