Improve how topic is managed on ws notifications

This commit is contained in:
Andrey Antukh 2024-10-30 12:32:03 +01:00 committed by Alonso Torres
parent 9409078069
commit 97a1bf15ef
6 changed files with 16 additions and 21 deletions

View file

@ -99,8 +99,9 @@
nil))
(defn pub!
[{::keys [pub-ch]} & {:as params}]
(sp/put! pub-ch params))
[{::keys [pub-ch]} & {:keys [topic] :as params}]
(let [params (update params :message assoc :topic topic)]
(sp/put! pub-ch params)))
(defn purge!
[{:keys [::state ::wrk/executor] :as msgbus} chans]
@ -230,7 +231,6 @@
(l/debug :hint "io-loop thread terminated")))))
(defn- redis-pub!
"Publish a message to the redis server. Asynchronous operation,
intended to be used in core.async go blocks."