net-mqtt 0.1.0.0 → 0.2.0.0
raw patch · 4 files changed
+21/−6 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Network.MQTT.Client: MQTTConfig :: String -> Int -> String -> Maybe String -> Maybe String -> Bool -> Maybe LastWill -> Maybe (Topic -> ByteString -> IO ()) -> MQTTConfig
+ Network.MQTT.Client: MQTTConfig :: String -> Int -> String -> Maybe String -> Maybe String -> Bool -> Maybe LastWill -> Maybe (MQTTClient -> Topic -> ByteString -> IO ()) -> MQTTConfig
- Network.MQTT.Client: [_msgCB] :: MQTTConfig -> Maybe (Topic -> ByteString -> IO ())
+ Network.MQTT.Client: [_msgCB] :: MQTTConfig -> Maybe (MQTTClient -> Topic -> ByteString -> IO ())
Files
- Changelog.md +14/−0
- app/Main.hs +1/−1
- net-mqtt.cabal +3/−2
- src/Network/MQTT/Client.hs +3/−3
+ Changelog.md view
@@ -0,0 +1,14 @@+# Changelog for net-mqtt++## 0.2.0.0++### API Change++Subscriber callbacks now include the MQTT client as the first+argument. This breaks a circular dependency that prevented callbacks+from being able to publish messages easily.++### Other++Updated to stackage LTS 13.2+
app/Main.hs view
@@ -25,4 +25,4 @@ print =<< waitForClient mc cancel p - where showme t m = print (t,m)+ where showme _ t m = print (t,m)
net-mqtt.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 2e4a3950e20e2a35101f270d00e002870b13f22dc165ced24aa166762c501924+-- hash: d216fe9f0aa63caf396fca116a64146457a0c10dbb97ec4935c578e3158115f7 name: net-mqtt-version: 0.1.0.0+version: 0.2.0.0 synopsis: An MQTT Protocol Implementation. description: Please see the README on GitHub at <https://github.com/dustin/mqtt#readme> category: Network@@ -21,6 +21,7 @@ build-type: Simple extra-source-files: README.md+ Changelog.md source-repository head type: git
src/Network/MQTT/Client.hs view
@@ -71,7 +71,7 @@ data MQTTClient = MQTTClient { _ch :: TChan MQTTPkt , _pktID :: TVar Word16- , _cb :: Maybe (Topic -> BL.ByteString -> IO ())+ , _cb :: Maybe (MQTTClient -> Topic -> BL.ByteString -> IO ()) , _ts :: TVar [Async ()] , _acks :: TVar (Map (DispatchType,Word16) (TChan MQTTPkt)) , _st :: TVar ConnState@@ -87,7 +87,7 @@ , _password :: Maybe String -- ^ Optional password. , _cleanSession :: Bool -- ^ False if a session should be reused. , _lwt :: Maybe LastWill -- ^ LastWill message to be sent on client disconnect.- , _msgCB :: Maybe (Topic -> BL.ByteString -> IO ()) -- ^ Callback for incoming messages.+ , _msgCB :: Maybe (MQTTClient -> Topic -> BL.ByteString -> IO ()) -- ^ Callback for incoming messages. } -- | A default MQTTConfig. A _connID /should/ be provided by the client in the returned config,@@ -216,7 +216,7 @@ where notify = case _cb of Nothing -> pure ()- Just x -> x (blToText _pubTopic) _pubBody+ Just x -> x c (blToText _pubTopic) _pubBody manageQoS2 = do ch <- newTChanIO