mirror of
https://github.com/penpot/penpot.git
synced 2025-05-18 08:06:10 +02:00
✨ Adapt websockets code to the vertx module changes.
This commit is contained in:
parent
72c010374f
commit
cd8a907a86
1 changed files with 4 additions and 4 deletions
|
@ -17,9 +17,9 @@
|
||||||
[uxbox.util.uuid :as uuid]
|
[uxbox.util.uuid :as uuid]
|
||||||
[uxbox.util.transit :as t]
|
[uxbox.util.transit :as t]
|
||||||
[uxbox.util.blob :as blob]
|
[uxbox.util.blob :as blob]
|
||||||
[vertx.core :as vc]
|
|
||||||
[vertx.http :as vh]
|
[vertx.http :as vh]
|
||||||
[vertx.web :as vw]
|
[vertx.web :as vw]
|
||||||
|
[vertx.impl :as vi]
|
||||||
[vertx.util :as vu]
|
[vertx.util :as vu]
|
||||||
[vertx.eventbus :as ve])
|
[vertx.eventbus :as ve])
|
||||||
(:import
|
(:import
|
||||||
|
@ -88,7 +88,7 @@
|
||||||
(defn handler
|
(defn handler
|
||||||
[{:keys [user] :as req}]
|
[{:keys [user] :as req}]
|
||||||
(letfn [(on-init [ws]
|
(letfn [(on-init [ws]
|
||||||
(let [ctx (vc/current-context)
|
(let [ctx (vu/current-context)
|
||||||
fid (get-in req [:path-params :file-id])
|
fid (get-in req [:path-params :file-id])
|
||||||
ws (assoc ws
|
ws (assoc ws
|
||||||
:user-id user
|
:user-id user
|
||||||
|
@ -128,14 +128,14 @@
|
||||||
(-> (p/do! (on-init @local))
|
(-> (p/do! (on-init @local))
|
||||||
(p/then (fn [data]
|
(p/then (fn [data]
|
||||||
(vreset! local data)
|
(vreset! local data)
|
||||||
(.textMessageHandler ws (vu/fn->handler
|
(.textMessageHandler ws (vi/fn->handler
|
||||||
(fn [msg]
|
(fn [msg]
|
||||||
(-> (p/do! (on-message @local msg))
|
(-> (p/do! (on-message @local msg))
|
||||||
(p/then (fn [data]
|
(p/then (fn [data]
|
||||||
(when (instance? WebSocket data)
|
(when (instance? WebSocket data)
|
||||||
(vreset! local data))
|
(vreset! local data))
|
||||||
(.fetch ws 1)))))))
|
(.fetch ws 1)))))))
|
||||||
(.closeHandler ws (vu/fn->handler (fn [& args] (on-close @local))))))))))
|
(.closeHandler ws (vi/fn->handler (fn [& args] (on-close @local))))))))))
|
||||||
|
|
||||||
(defn ws-websocket
|
(defn ws-websocket
|
||||||
[]
|
[]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue