Created
July 20, 2013 08:59
-
-
Save siscia/6044379 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; I would be very surprised if it works... | |
(go | |
(loop [] | |
(let [c (chan) | |
tok (do | |
(reify MqttCallback | |
(deliveryComplete [_ tok] | |
(when-let 1 | |
(go (>! c :arrived)) | |
(swap! tok->chan dissoc tok)))) | |
(mqtt-publish client "sneezing" "[80 m/s]"))] | |
(swap! tok->chan assoc tok c) | |
(when-not (alts! c (timeout 10000)) | |
(recur))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment