♻️ Refactor presence and realtime cursors handling.

This commit is contained in:
Andrey Antukh 2020-04-27 08:54:43 +02:00 committed by Alonso Torres
parent 1c3664921d
commit 285735e35f
15 changed files with 519 additions and 318 deletions

View file

@ -33,17 +33,21 @@
:stop (.close ^AutoCloseable client))
(defstate conn
:start (redis/connect client)
:start @(redis/connect client)
:stop (.close ^AutoCloseable conn))
;; --- API FORWARD
(defmacro with-conn
[& args]
`(redis/with-conn ~@args))
(defn subscribe
[topic]
(redis/subscribe client topic))
(defn run!
[conn cmd params]
[cmd params]
(let [ctx (vu/get-or-create-context system)]
(-> (redis/run! conn cmd params)
(vu/handle-on-context ctx))))
(defn run
[cmd params]
(redis/run conn cmd params))