mirror of
https://github.com/penpot/penpot.git
synced 2025-05-24 04:46:11 +02:00
♻️ Refactor presence and realtime cursors handling.
This commit is contained in:
parent
1c3664921d
commit
285735e35f
15 changed files with 519 additions and 318 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue