amqp 0.2.1 → 0.2.2
raw patch · 3 files changed
+13/−4 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Network/AMQP.hs +11/−3
- amqp.cabal +1/−1
- examples/ExampleProducer.hs +1/−0
Network/AMQP.hs view
@@ -541,6 +541,7 @@ connChannels :: (MVar (IM.IntMap (Channel, ThreadId))), --open channels (channelID => (Channel, ChannelThread)) connMaxFrameSize :: Int, --negotiated maximum frame size connClosed :: MVar (Maybe String),+ connClosedLock :: MVar (), -- used by closeConnection to block until connection-close handshake is complete connWriteLock :: MVar (), -- to ensure atomic writes to the socket lastChannelID :: MVar Int --for auto-incrementing the channelIDs }@@ -623,7 +624,8 @@ lastChanID <- newMVar 0 cClosed <- newMVar Nothing writeLock <- newMVar ()- let conn = Connection sock connChannels (fromIntegral maxFrameSize) cClosed writeLock lastChanID+ ccl <- newEmptyMVar+ let conn = Connection sock connChannels (fromIntegral maxFrameSize) cClosed ccl writeLock lastChanID --spawn the connectionReceiver forkIO $ CE.finally (connectionReceiver conn) @@ -635,6 +637,9 @@ --kill all channel-threads withMVar connChannels $ \cc -> mapM_ (\c -> killThread $ snd c) $ IM.elems cc withMVar connChannels $ \cc -> return $ IM.empty+ + -- mark connection as closed, so all pending calls to 'closeConnection' can now return+ tryPutMVar ccl () ) return conn@@ -651,7 +656,8 @@ True))) --insist; True because we don't support redirect yet - + + -- | closes a connection closeConnection :: Connection -> IO () closeConnection c = do@@ -668,7 +674,9 @@ --do nothing if connection is already closed return () ) - -- connection_close_ok will be handled in the "connectionReceiver" method above+ + -- wait for connection_close_ok by the server+ readMVar $ connClosedLock c return ()
amqp.cabal view
@@ -1,5 +1,5 @@ Name: amqp -Version: 0.2.1 +Version: 0.2.2 Synopsis: Client library for AMQP servers (currently only RabbitMQ) Description: Client library for AMQP servers (currently only RabbitMQ) License: BSD3
examples/ExampleProducer.hs view
@@ -28,6 +28,7 @@ closeConnection conn +