Skip to content

Commit

Permalink
send bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
awb99 committed Jun 25, 2024
1 parent 89e319c commit bef9567
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions src/modular/ws/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,19 @@

;; SEND

(defn send! [this uid data]
(let [{:keys [chsk-send!]} this]
(defn send! [{:keys [conn] :as _this} uid data]
(let [{:keys [chsk-send!]} conn]
(when-not (= uid :sente/nil-uid)
(chsk-send! uid data))))

(defn connected-uids [{:keys [conn]}]
(let [{:keys [connected-uids]} conn]
(:any @connected-uids)))

(defn send-all! [this data]
(let [{:keys [connected-uids]} this
uids (:any @connected-uids)
(let [uids (connected-uids this)
nr (count uids)]
(when (> nr 0)
(debugf "Broadcasting event type: %s to %s clients" (first data) nr)
(doseq [uid uids]
(send! this uid data)))))

;; WATCH

(defn connected-uids [this]
(let [conn (:conn this)
{:keys [connected-uids]} conn
uids (:any @connected-uids)]
uids))






(send! this uid data)))))

0 comments on commit bef9567

Please sign in to comment.