snaplet-amqp 1.0.0.0 → 1.0.1.0
raw patch · 3 files changed
+14/−6 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- README.org +8/−0
- snaplet-amqp.cabal +1/−1
- src/Snap/Snaplet/AMQP.hs +5/−5
README.org view
@@ -5,6 +5,14 @@ =snaplet-amqp= provides a convenience interface to the Haskell AMQP package. + Because the AMQP package doesn't provide its own connection pooling+ mechanism, this snaplet uses the =resource-pool= package to create a+ pool of ten connections (only connections, not channels).++ When the =runAmqp= function is used a connection from the pool is+ leased, a channel is created and both the connection and channel are+ applied to the supplied action.+ #+BEGIN_SRC {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-}
snaplet-amqp.cabal view
@@ -1,5 +1,5 @@ Name: snaplet-amqp-Version: 1.0.0.0+Version: 1.0.1.0 Synopsis: Snap framework snaplet for the AMQP library Homepage: https://github.com/ixmatus/snaplet-amqp License: BSD3
src/Snap/Snaplet/AMQP.hs view
@@ -44,11 +44,11 @@ -- | Initialize the AMQP Snaplet. initAMQP :: SnapletInit b AmqpState initAMQP = makeSnaplet "amqp" description datadir $ do- c <- mkSnapletAmqpPoolonn+ p <- mkSnapletAmqpPool - -- onUnload (closeConnection $ fst c)+ onUnload (destroyAllResources p) - return $ AmqpState c+ return $ AmqpState p where description = "Snaplet for AMQP library"@@ -56,8 +56,8 @@ ------------------------------------------------------------------------------- -- | Constructs a connection in a snaplet context.-mkSnapletAmqpPoolonn :: (MonadIO (m b v), MonadSnaplet m) => m b v AmqpPool-mkSnapletAmqpPoolonn = do+mkSnapletAmqpPool :: (MonadIO (m b v), MonadSnaplet m) => m b v AmqpPool+mkSnapletAmqpPool = do conf <- getSnapletUserConfig mkAmqpPool conf