connection-pool-0.1.2.1: Connection pool built on top of resource-pool and streaming-commons.

Copyright(c) 2014-2015, Peter Trško
LicenseBSD3
Maintainerpeter.trsko@gmail.com
Stabilityunstable (internal module)
Portabilitynon-portable (CPP, FlexibleContexts, NoImplicitPrelude)
Safe HaskellNone
LanguageHaskell2010

Data.ConnectionPool.Internal.Streaming

Contents

Description

Module defines helper functions that would be ideally provided by streaming-commons package and some wrappers with specialised type signatures.

Internal packages are here to provide access to internal definitions for library writers, but they should not be used in application code.

Preferably use qualified import, e.g.:

import qualified Data.ConnectionPool.Internal.Streaming as Internal

This module doesn't neither depend on resource-pool package nor any other module of this package, and it shoud stay that way. This module uses CPP to get OS specific things right. Most importantly Windows doesn't support UNIX Sockets.

Please, bear above in mind when doing modifications.

Synopsis

TCP

acquireTcpClientConnection :: ClientSettings -> IO (Socket, SockAddr) Source

Wrapper for getSocketFamilyTCP that takes ClientSettings instead of individual parameters.

runTcpApp :: MonadBaseControl IO m => Maybe SockAddr -> (AppData -> m r) -> Socket -> SockAddr -> m r Source

Wrapper for runTcpAppImpl with a type signature that is more natural for implementing a TCP specific withConnection.

runTcpAppImpl :: MonadBaseControl IO m => Maybe SockAddr -> Socket -> SockAddr -> (AppData -> m r) -> m r Source

Simplified runTCPClient and runTCPServer that provides only construction of AppData and passing it to a callback function.

Unix Socket

runUnixApp :: MonadBaseControl IO m => (AppDataUnix -> m r) -> Socket -> () -> m r Source

Wrapper for runUnixAppImpl with a type signature that is more natural for implementing a UNIX Socket specific withConnection.

runUnixAppImpl :: MonadBaseControl IO m => Socket -> (AppDataUnix -> m r) -> m r Source

Simplified runUnixClient and runUnixServer that provides only construction of AppDataUnix and passing it to a callback function.