packages feed

connection-pool 0.2 → 0.2.1

raw patch · 13 files changed

+95/−71 lines, 13 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Data.ConnectionPool.Internal.ConnectionPool: instance GHC.Generics.Constructor Data.ConnectionPool.Internal.ConnectionPool.C1_0ConnectionPool
- Data.ConnectionPool.Internal.ConnectionPool: instance GHC.Generics.Datatype Data.ConnectionPool.Internal.ConnectionPool.D1ConnectionPool
- Data.ConnectionPool.Internal.ConnectionPool: instance GHC.Generics.Selector Data.ConnectionPool.Internal.ConnectionPool.S1_0_0ConnectionPool
- Data.ConnectionPool.Internal.ConnectionPool: instance GHC.Generics.Selector Data.ConnectionPool.Internal.ConnectionPool.S1_0_1ConnectionPool
- Data.ConnectionPool.Internal.HandlerParams: instance GHC.Generics.Constructor Data.ConnectionPool.Internal.HandlerParams.C1_0HandlerParams
- Data.ConnectionPool.Internal.HandlerParams: instance GHC.Generics.Datatype Data.ConnectionPool.Internal.HandlerParams.D1HandlerParams
- Data.ConnectionPool.Internal.HandlerParams: instance GHC.Generics.Selector Data.ConnectionPool.Internal.HandlerParams.S1_0_0HandlerParams
- Data.ConnectionPool.Internal.ResourcePoolParams: instance GHC.Generics.Constructor Data.ConnectionPool.Internal.ResourcePoolParams.C1_0ResourcePoolParams
- Data.ConnectionPool.Internal.ResourcePoolParams: instance GHC.Generics.Datatype Data.ConnectionPool.Internal.ResourcePoolParams.D1ResourcePoolParams
- Data.ConnectionPool.Internal.ResourcePoolParams: instance GHC.Generics.Selector Data.ConnectionPool.Internal.ResourcePoolParams.S1_0_0ResourcePoolParams
- Data.ConnectionPool.Internal.ResourcePoolParams: instance GHC.Generics.Selector Data.ConnectionPool.Internal.ResourcePoolParams.S1_0_1ResourcePoolParams
- Data.ConnectionPool.Internal.ResourcePoolParams: instance GHC.Generics.Selector Data.ConnectionPool.Internal.ResourcePoolParams.S1_0_2ResourcePoolParams
- Data.ConnectionPool.Internal.TCP: instance GHC.Generics.Constructor Data.ConnectionPool.Internal.TCP.C1_0R:ConnectionPool*TcpClient
- Data.ConnectionPool.Internal.TCP: instance GHC.Generics.Datatype Data.ConnectionPool.Internal.TCP.D1R:ConnectionPool*TcpClient
- Data.ConnectionPool.Internal.TCP: instance GHC.Generics.Datatype Data.ConnectionPool.Internal.TCP.D1TcpClient
- Data.ConnectionPool.Internal.Unix: instance GHC.Generics.Constructor Data.ConnectionPool.Internal.Unix.C1_0R:ConnectionPool*UnixClient
- Data.ConnectionPool.Internal.Unix: instance GHC.Generics.Datatype Data.ConnectionPool.Internal.Unix.D1R:ConnectionPool*UnixClient
- Data.ConnectionPool.Internal.Unix: instance GHC.Generics.Datatype Data.ConnectionPool.Internal.Unix.D1UnixClient
+ Data.ConnectionPool: type family HandlerData protocol;
+ Data.ConnectionPool: }
+ Data.ConnectionPool.Class: type family HandlerData protocol;
+ Data.ConnectionPool.Class: }
- Data.ConnectionPool: class ConnectionPoolFor (protocol :: k) where type family HandlerData protocol
+ Data.ConnectionPool: class ConnectionPoolFor (protocol :: k) where type HandlerData protocol where {
- Data.ConnectionPool.Class: class ConnectionPoolFor (protocol :: k) where type family HandlerData protocol
+ Data.ConnectionPool.Class: class ConnectionPoolFor (protocol :: k) where type HandlerData protocol where {
- Data.ConnectionPool.Internal.Streaming: runTcpApp :: MonadBaseControl IO m => Maybe SockAddr -> (AppData -> m r) -> HandlerParams -> Socket -> SockAddr -> m r
+ Data.ConnectionPool.Internal.Streaming: runTcpApp :: Maybe SockAddr -> (AppData -> m r) -> HandlerParams -> Socket -> SockAddr -> m r
- Data.ConnectionPool.Internal.Streaming: runTcpAppImpl :: MonadBaseControl IO m => Maybe SockAddr -> Socket -> SockAddr -> Int -> (AppData -> m r) -> m r
+ Data.ConnectionPool.Internal.Streaming: runTcpAppImpl :: Maybe SockAddr -> Socket -> SockAddr -> Int -> (AppData -> m r) -> m r
- Data.ConnectionPool.Internal.Streaming: runUnixApp :: MonadBaseControl IO m => (AppDataUnix -> m r) -> HandlerParams -> Socket -> () -> m r
+ Data.ConnectionPool.Internal.Streaming: runUnixApp :: (AppDataUnix -> m r) -> HandlerParams -> Socket -> () -> m r
- Data.ConnectionPool.Internal.Streaming: runUnixAppImpl :: MonadBaseControl IO m => Socket -> Int -> (AppDataUnix -> m r) -> m r
+ Data.ConnectionPool.Internal.Streaming: runUnixAppImpl :: Socket -> Int -> (AppDataUnix -> m r) -> m r

Files

ChangeLog.md view
@@ -1,6 +1,16 @@ # ChangeLog / ReleaseNotes  +## Version 0.2.1++* Relaxed upper bound on base to include version 4.9.\*.+* Relaxed bounds for [data-default-class][] to include 0.1.\*.+* Getting rid of compilation warnings on GHC 8 and when compiled with pedantic+  flag.+* Uploaded to [Hackage][]:+  <http://hackage.haskell.org/package/connection-pool-0.2.1>++ ## Version 0.2  * Release has backward compatible API with 0.1 branch.@@ -26,7 +36,7 @@   packages depending on internal API. (**change**) * Heavy inlining of everything. Purpose is to be safe that this library gets   abstracted away as much as possible. Best result is if only direct references-  to resource-pool and streaming-commons remain. (**change**)+  to [resource-pool][] and [streaming-commons][] remain. (**change**) * Uploaded to [Hackage][]:   <http://hackage.haskell.org/package/connection-pool-0.2> @@ -89,13 +99,15 @@ [between]:   http://hackage.haskell.org/package/between   "Function combinator 'between' and derived combinators."+[data-default-class]:+  http://hackage.haskell.org/package/data-default-class+  "Default type class provides a default value (def) of a type." [Hackage]:   http://hackage.haskell.org/   "HackageDB (or just Hackage) is a collection of releases of Haskell packages."+[resource-pool]:+  http://hackage.haskell.org/package/resource-pool+  "A high-performance striped pooling abstraction for managing resources." [streaming-commons]:   http://hackage.haskell.org/package/streaming-commons   "Low-dependency functionality commonly needed by various streaming data libraries"--<!---  vim: filetype=markdown softtabstop=4 shiftwidth=4 expandtab--->
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2014-2015, Peter Trško+Copyright (c) 2014-2016 Peter Trško  All rights reserved. 
README.md view
@@ -13,7 +13,7 @@ Description ----------- -Connection poll is a family specialised resource pools. Currently package+Connection pool is a family specialised resource pools. Currently package provides two  1. pool for TCP client connections,
connection-pool.cabal view
@@ -1,5 +1,5 @@ name:                   connection-pool-version:                0.2+version:                0.2.1 synopsis:   Connection pool built on top of resource-pool and streaming-commons. description:@@ -29,7 +29,7 @@ license-file:           LICENSE author:                 Peter Trško maintainer:             peter.trsko@gmail.com-copyright:              (c) 2014-2015, Peter Trško+copyright:              (c) 2014-2016 Peter Trško category:               Data, Network build-type:             Simple cabal-version:          >=1.10@@ -74,30 +74,29 @@     , TypeFamilies    build-depends:-    -- {{{ Packages distributed with HaskellPlatform (or GHC itself) -----------      base >=4.6 && <4.9-    , network >= 2.2.3+      base >=4.6 && <5++    , network >=2.2.3       -- Version 2.2.3 introduced module "Network.Socket.ByteString".-    , time >= 1.0+    , time >=1.0       -- Version 1.0 is the oldest available version of time on Hackage and it-      -- defines NominalDiffTime. Package -- resource-pool doesn't define any+      -- defines NominalDiffTime. Package resource-pool doesn't define any       -- version boundaries on this package.-    -- }}} Packages distributed with HaskellPlatform (or GHC itself) ------------    -- {{{ Other packages ------------------------------------------------------    , between >= 0.10.0.0-    -- ^ This package uses strict API which was introduced in version 0.10.0.0.-    , data-default-class == 0.0.*-    , monad-control >= 0.3+    , between >=0.10.0.0+      -- This package uses strict API which was introduced in version 0.10.0.0.+    , data-default-class ==0.0.* || ==0.1.*+      -- API between 0.0.1 and 0.1.0 versions hadn't changed, it just gained+      -- the possibility to define instances using GHC Generics.+    , monad-control >=0.3       -- Package resource-pool depends on monad-control >=0.2.0.1 since       -- resource-pool version 0.2.0.0, but this package doesn't make the       -- effort to handle changes in monad-control API and therefore it limits       -- its dependencies to >=0.3.-    , resource-pool >= 0.2.0.0 && < 1+    , resource-pool >=0.2.0.0 && <1       -- Version 0.2.0.0 of resource-pool was the first that used monad-control       -- package. At the time of writing (version 0.2.3.0) used subset of API       -- is stable.-    , streaming-commons >= 0.1.3 && < 0.2+    , streaming-commons >=0.1.3 && <0.2       -- First version that had getSocketFamilyTCP function and also Earlier       -- versions have different definition of ClientSettings. Those two things       -- are actually related.@@ -112,10 +111,9 @@       -- * Version 0.1.14 exports HasReadBufferSize type class and it also has       --   instance for ClientSettingsUnix. See       --   https://github.com/fpco/streaming-commons/pull/24 for details.-    , transformers-base >= 0.4.2 && < 0.5+    , transformers-base >=0.4.2 && <0.5       -- Version bounds taken from latest monad-control package (at the moment       -- 0.3.3.0), which is a dependency of resource-pool package.-    -- }}} Other packages -----------------------------------------------------    if os(windows)     cpp-options:        -DWINDOWS@@ -148,4 +146,4 @@ source-repository this   type:                 git   location:             git://github.com/trskop/connection-pool.git-  tag:                  v0.2+  tag:                  v0.2.1
src/Data/ConnectionPool.hs view
@@ -3,12 +3,12 @@ -- | -- Module:       $HEADER$ -- Description:  Connection pools for various transport protocols.--- Copyright:    (c) 2014-2015, Peter Trško+-- Copyright:    (c) 2014-2016 Peter Trško -- License:      BSD3 -- -- Maintainer:   peter.trsko@gmail.com -- Stability:    unstable--- Portability:  CPP, NoImplicitPrelude+-- Portability:  GHC specific language extensions. -- -- Connection pools for TCP clients and UNIX Socket clients, later is not -- supported on Windows.@@ -105,7 +105,14 @@     -- !WINDOWS     ) -import Data.ConnectionPool.Class (ConnectionPoolFor(..))+import Data.ConnectionPool.Class+    ( ConnectionPoolFor+        ( HandlerData+        , destroyAllConnections+        , tryWithConnection+        , withConnection+        )+    ) import Data.ConnectionPool.Family (ConnectionPool) import Data.ConnectionPool.Internal.ResourcePoolParams     ( ResourcePoolParams@@ -323,6 +330,10 @@  -- $constructingConnectionPool --+-- This section describes basic principles that are shared among provided+-- connection pools. It can also provide basic information in case of creating+-- new connection pool while using API and types from this package.+-- -- For each protocol we provide separate function that creates 'ConnectionPool' -- instance. For TCP clients it's 'createTcpClientPool' and for UNIX Socket -- clients it's 'createUnixClientPool' (not available on Windows).@@ -365,13 +376,14 @@ -- @ -- -- Where functions @&@ and @.~@ are defined by--- <http://hackage.haskell.org/package/lens lens> package.+-- <http://hackage.haskell.org/package/lens lens> package. Function+-- 'Data.Function.&' is also available in base >= 4.8.  -- $resourcePoolParamsLenses -- -- For details on how to use leses as these see -- <http://hackage.haskell.org/package/lens lens> package where you might find--- a good starting point documentation for you.+-- a good starting point.  -- $resourcePoolParamsValidation --@@ -388,4 +400,5 @@ -- -- Most usually one would use 'Data.Default.def' instead of @someParams@. -- Functions @&@ and @.~@ are defined in--- <http://hackage.haskell.org/package/lens lens> package.+-- <http://hackage.haskell.org/package/lens lens> package. Function+-- 'Data.Function.&' is also available in base >= 4.8.
src/Data/ConnectionPool/Class.hs view
@@ -12,13 +12,12 @@ -- | -- Module:       $HEADER$ -- Description:  Type class for common connection pool operations.--- Copyright:    (c) 2015, Peter Trško+-- Copyright:    (c) 2015 Peter Trško -- License:      BSD3 -- -- Maintainer:   peter.trsko@gmail.com -- Stability:    unstable--- Portability:  CPP, FlexibleContexts, NoImplicitPrelude, PolyKinds,---               TypeFamilies+-- Portability:  GHC specific language extensions. -- -- Type class for common connection pool operations. module Data.ConnectionPool.Class
src/Data/ConnectionPool/Family.hs view
@@ -19,13 +19,12 @@ -- | -- Module:       $HEADER$ -- Description:  Family of connection pools specialized by transport protocol.--- Copyright:    (c) 2014-2015, Peter Trško+-- Copyright:    (c) 2014-2015 Peter Trško -- License:      BSD3 -- -- Maintainer:   peter.trsko@gmail.com -- Stability:    stable--- Portability:  CPP, DeriveDataTypeable, PolyKinds, StandaloneDeriving,---               NoImplicitPrelude, TypeFamilies+-- Portability:  GHC specific language extensions. -- -- Module defines data family of connection pools that is later specialised -- for various protocols and implementations.
src/Data/ConnectionPool/Internal/ConnectionPool.hs view
@@ -9,14 +9,12 @@ -- | -- Module:       $HEADER$ -- Description:  ConnectionPool data type which is a specialized Pool wrapper.--- Copyright:    (c) 2014-2015, Peter Trško+-- Copyright:    (c) 2014-2015 Peter Trško -- License:      BSD3 -- -- Maintainer:   peter.trsko@gmail.com -- Stability:    unstable (internal module)--- Portability:  DeriveDataTypeable, DeriveGeneric, FunctionalDependencies,---               FlexibleContexts, MultiParamTypeClasses, NamedFieldPuns,---               NoImplicitPrelude, RecordWildCards+-- Portability:  GHC specific language extensions. -- -- Internal packages are here to provide access to internal definitions for -- library writers, but they should not be used in application code.
src/Data/ConnectionPool/Internal/HandlerParams.hs view
@@ -5,12 +5,12 @@ -- Module:       $HEADER$ -- Description:  HandlerParams data type which is passed to individual --               connection.--- Copyright:    (c) 2015, Peter Trško+-- Copyright:    (c) 2015 Peter Trško -- License:      BSD3 -- -- Maintainer:   peter.trsko@gmail.com -- Stability:    unstable (internal module)--- Portability:  DeriveDataTypeable, DeriveGeneric, NoImplicitPrelude+-- Portability:  GHC specific language extensions. -- -- Internal packages are here to provide access to internal definitions for -- library writers, but they should not be used in application code.
src/Data/ConnectionPool/Internal/ResourcePoolParams.hs view
@@ -5,12 +5,12 @@ -- | -- Module:       $HEADER$ -- Description:  Resource pool construction parameters.--- Copyright:    (c) 2014, Peter Trško+-- Copyright:    (c) 2014 Peter Trško -- License:      BSD3 -- -- Maintainer:   peter.trsko@gmail.com -- Stability:    unstable (internal module)--- Portability:  DeriveDataTypeable, NoImplicitPrelude, RecordWildCards+-- Portability:  GHC specific language extensions. -- -- Internal packages are here to provide access to internal definitions for -- library writers, but they should not be used in application code.
src/Data/ConnectionPool/Internal/Streaming.hs view
@@ -4,12 +4,12 @@ -- | -- Module:       $HEADER$ -- Description:  Helper functions that aren't provided by streaming-commons.--- Copyright:    (c) 2014-2015, Peter Trško+-- Copyright:    (c) 2014-2016 Peter Trško -- License:      BSD3 -- -- Maintainer:   peter.trsko@gmail.com -- Stability:    unstable (internal module)--- Portability:  CPP, FlexibleContexts, NoImplicitPrelude+-- Portability:  GHC specific language extensions. -- -- Module defines helper functions that would be ideally provided by -- <http://hackage.haskell.org/package/streaming-commons streaming-commons>@@ -54,7 +54,6 @@ import Data.Maybe (Maybe(Just)) import System.IO (IO) -import Control.Monad.Trans.Control (MonadBaseControl) import Network.Socket (Socket, SockAddr, sClose) import Network.Socket.ByteString (sendAll) @@ -117,10 +116,9 @@ -- for implementing a TCP specific -- 'Data.ConnectionPool.Internal.ConnectionPool.withConnection'. ----- /Definition changed in version 0.1.3./+-- /Definition changed in version 0.1.3 and 0.2.1./ runTcpApp-    :: MonadBaseControl IO m-    => Maybe SockAddr+    :: Maybe SockAddr     -> (AppData -> m r)     -> HandlerParams     -- ^ Parameters passed down to connection handler @('AppData' -> m r)@ as@@ -139,10 +137,9 @@ -- 'Data.Streaming.Network.runTCPServer' that provides only construction of -- 'AppData' and passing it to a callback function. ----- /Definition changed in version 0.1.3./+-- /Definition changed in version 0.1.3 and 0.2.1./ runTcpAppImpl-    :: MonadBaseControl IO m-    => Maybe SockAddr+    :: Maybe SockAddr     -> Socket     -> SockAddr     -> Int@@ -193,10 +190,9 @@ -- for implementing a UNIX Socket specific -- 'Data.ConnectionPool.Internal.ConnectionPool.withConnection'. ----- /Definition changed in version 0.1.3./+-- /Definition changed in version 0.1.3 and 0.2.1./ runUnixApp-    :: MonadBaseControl IO m-    => (AppDataUnix -> m r)+    :: (AppDataUnix -> m r)     -> HandlerParams     -- ^ Parameters passed down to connection handler @('AppDataUnix' -> m r)@ as     -- part of definition of 'AppDataUnix'.@@ -213,10 +209,9 @@ -- 'Data.Streaming.Network.runUnixServer' that provides only construction of -- 'AppDataUnix' and passing it to a callback function. ----- /Definition changed in version 0.1.3./+-- /Definition changed in version 0.1.3 and 0.2.1./ runUnixAppImpl-    :: MonadBaseControl IO m-    => Socket+    :: Socket     -> Int     -- ^ Buffer size used while reading from socket. /Since version 0.1.3./     -> (AppDataUnix -> m r)
src/Data/ConnectionPool/Internal/TCP.hs view
@@ -12,14 +12,12 @@ -- | -- Module:       $HEADER$ -- Description:  Family of connection pools specialized by transport protocol.--- Copyright:    (c) 2014-2015, Peter Trško+-- Copyright:    (c) 2014-2016 Peter Trško -- License:      BSD3 -- -- Maintainer:   peter.trsko@gmail.com -- Stability:    unstable (internal module)--- Portability:  CPP, DeriveDataTypeable, DeriveGeneric, FlexibleInstances,---               MultiParamTypeClasses, NoImplicitPrelude, PolyKinds,---               StandaloneDeriving, TypeFamilies+-- Portability:  GHC specific language extensions. -- -- Module defines type family of connection pools that is later specialised -- using type tags (phantom types) to specialize implementation of underlying@@ -62,7 +60,14 @@     , ClientSettings     ) -import Data.ConnectionPool.Class (ConnectionPoolFor(..))+import Data.ConnectionPool.Class+    ( ConnectionPoolFor+        ( HandlerData+        , destroyAllConnections+        , tryWithConnection+        , withConnection+        )+    ) import Data.ConnectionPool.Family (ConnectionPool) import Data.ConnectionPool.Internal.ConnectionPool     ( HasConnectionPool(connectionPool)
src/Data/ConnectionPool/Internal/Unix.hs view
@@ -13,14 +13,12 @@ -- | -- Module:       $HEADER$ -- Description:  Family of connection pools specialized by transport protocol.--- Copyright:    (c) 2014-2015, Peter Trško+-- Copyright:    (c) 2014-2016 Peter Trško -- License:      BSD3 -- -- Maintainer:   peter.trsko@gmail.com -- Stability:    unstable (internal module)--- Portability:  CPP, DeriveDataTypeable, DeriveGeneric, FlexibleInstances,---               MultiParamTypeClasses, NoImplicitPrelude, PolyKinds,---               StandaloneDeriving, TupleSections, TypeFamilies+-- Portability:  GHC specific language extensions. -- -- Module defines type family of connection pools that is later specialised -- using type tags (phantom types) to specialize implementation of underlying@@ -68,7 +66,14 @@     , getSocketUnix     ) -import Data.ConnectionPool.Class (ConnectionPoolFor(..))+import Data.ConnectionPool.Class+    ( ConnectionPoolFor+        ( HandlerData+        , destroyAllConnections+        , tryWithConnection+        , withConnection+        )+    ) import Data.ConnectionPool.Family (ConnectionPool) import Data.ConnectionPool.Internal.ConnectionPool     ( HasConnectionPool(connectionPool)