feat: Add new client functions for messaging and connection handling
This commit is contained in:
@@ -1,13 +1,35 @@
|
|||||||
(ns milquetoast.client
|
(ns milquetoast.client
|
||||||
(:require [milquetoast.api :as api])
|
(:require [milquetoast.api :as api]))
|
||||||
(:import [clojure.lang ExceptionInfo]))
|
|
||||||
|
|
||||||
(defn- deprecated [f]
|
(defn send! [client topic msg & {:keys [qos retain]
|
||||||
(fn [& args]
|
:or {qos 1 retain false}}]
|
||||||
(println (str "WARNING: The function '" (name f) "' in the 'milquetoast.client' namespace is deprecated. Please use 'milquetoast.api' instead."))
|
...)
|
||||||
(apply f args)))
|
|
||||||
|
|
||||||
(defmacro defdeprecated [name & body]
|
(defn get! [client topic & options]
|
||||||
`(def ~name (deprecated (fn ~@body))))
|
...)
|
||||||
|
|
||||||
(println "WARNING: The 'milquetoast.client' namespace is deprecated. Please use 'milquetoast.api' instead.")
|
(defn get-raw! [client topic & options]
|
||||||
|
...)
|
||||||
|
|
||||||
|
(defn open-channel!
|
||||||
|
[client topic & {:keys [buffer-size qos retain]
|
||||||
|
:or {buffer-size 1
|
||||||
|
qos 1
|
||||||
|
retain false}}]
|
||||||
|
...)
|
||||||
|
|
||||||
|
(defn subscribe!
|
||||||
|
[client topic & {:keys [buffer-size qos]
|
||||||
|
:or {buffer-size 1
|
||||||
|
qos 1}}]
|
||||||
|
...)
|
||||||
|
|
||||||
|
(defn connect!
|
||||||
|
[& {:keys [host port scheme verbose]
|
||||||
|
:or {verbose false
|
||||||
|
scheme :tcp}
|
||||||
|
:as opts}]
|
||||||
|
...)
|
||||||
|
|
||||||
|
(defn connect-json! [& args]
|
||||||
|
...)
|
||||||
|
|||||||
Reference in New Issue
Block a user