net-mqtt: An MQTT Protocol Implementation.

[ bsd3, library, network, program ] [ Propose Tags ]

Please see the README on GitHub at https://github.com/dustin/mqtt-hs#readme


[Skip to Readme]
Versions [faq] 0.1.0.0, 0.2.0.0, 0.2.1.0, 0.2.2.0, 0.2.3.0, 0.2.3.1, 0.2.4.0, 0.2.4.1, 0.2.4.2, 0.5.0.0, 0.5.0.1, 0.5.0.2, 0.5.1.0, 0.6.0.0, 0.6.0.1, 0.6.0.2, 0.6.1.0, 0.6.1.1, 0.6.2.0, 0.6.2.1, 0.6.2.2, 0.6.2.3
Change log Changelog.md
Dependencies async (>=2.2.1 && <2.3), attoparsec (>=0.13.2 && <0.14), attoparsec-binary (>=0.2 && <1.0), base (>=4.7 && <5), binary (>=0.8.5 && <0.9), bytestring (>=0.10.8 && <0.11), conduit (>=1.3.1 && <1.4), conduit-extra (>=1.3.0 && <1.4), connection (>=0.2.0 && <0.4), containers (>=0.5.0 && <0.7), deepseq (>=1.4.4.0 && <1.5), net-mqtt, network-conduit-tls (>=1.3.2 && <1.4), network-uri (>=2.6.1 && <2.7), optparse-applicative, QuickCheck (>=2.12.6.1 && <2.14), stm (>=2.4.0 && <2.6), text (>=1.2.3 && <1.3), websockets (>=0.12.5.3 && <0.13) [details]
License BSD-3-Clause
Copyright BSD3
Author Dustin Sallings
Maintainer dustin@spy.net
Category Network
Home page https://github.com/dustin/mqtt-hs#readme
Bug tracker https://github.com/dustin/mqtt-hs/issues
Source repo head: git clone https://github.com/dustin/mqtt-hs
Uploaded by dustin at Mon Feb 17 01:46:20 UTC 2020
Distributions NixOS:0.6.2.2
Executables mqtt-watch, mqtt-example
Downloads 4366 total (728 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2020-02-17 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for net-mqtt-0.6.2.3

[back to package description]

mqtt

An MQTT protocol implementation for Haskell.

Client Examples

Publish

main :: IO ()
main = do
  let (Just uri) = parseURI "mqtt://test.mosquitto.org"
  mc <- connectURI mqttConfig{} uri
  publish mc "tmp/topic" "hello!" False

Subscribe

main :: IO ()
main = do
  let (Just uri) = parseURI "mqtt://test.mosquitto.org"
  mc <- connectURI mqttConfig{_msgCB=SimpleCallback msgReceived} uri
  print =<< subscribe mc [("tmp/topic1", subOptions), ("tmp/topic2", subOptions)] []
  waitForClient mc   -- wait for the the client to disconnect

  where
    msgReceived _ t m p = print (t,m,p)