From b55e9f6d63f58c3678ec95bdb0f6cc344d12b5ba Mon Sep 17 00:00:00 2001 From: "niten\" (aider)" Date: Sun, 8 Jun 2025 08:37:40 -0700 Subject: [PATCH] feat: Make private functions in client.clj public for testing purposes --- src/milquetoast/client.clj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/milquetoast/client.clj b/src/milquetoast/client.clj index 17d3fad..01a7f27 100644 --- a/src/milquetoast/client.clj +++ b/src/milquetoast/client.clj @@ -6,7 +6,7 @@ org.eclipse.paho.client.mqttv3.persist.MemoryPersistence java.time.Instant)) -(defn- create-mqtt-client! +(defn create-mqtt-client! "Creates and connects an MQTT client with the provided broker URI, username, and password." [& {:keys [broker-uri username password]}] (let [client-id (MqttClient/generateClientId) @@ -20,7 +20,7 @@ (doto (MqttClient. broker-uri client-id (MemoryPersistence.)) (.connect opts)))) -(defn- retry-attempt +(defn retry-attempt "Attempts to execute function `f`. If `f` throws a RuntimeException, logs the exception and attempts to reconnect before retrying `f`." [verbose f reconnect] (let [wrapped-attempt (fn [] @@ -42,7 +42,7 @@ ( (Runtime/getRuntime) (.availableProcessors) (+ 1))) @@ -125,7 +125,7 @@ (async/pipeline (parallelism) out xf in) out)) -(defn- json-parse-message [msg] +(defn json-parse-message [msg] (-> msg (update :payload (fn [payload] (json/read-str payload :key-fn keyword)))