♻️ Refactor backend.

Move from custom vertx to jetty9.
This commit is contained in:
Andrey Antukh 2020-05-14 13:49:11 +02:00 committed by Alonso Torres
parent 1639e15975
commit 5a03c13731
82 changed files with 1763 additions and 4667 deletions

View file

@ -10,13 +10,10 @@
[clojure.tools.logging :as log]
[lambdaisland.uri :refer [uri]]
[mount.core :as mount :refer [defstate]]
[promesa.core :as p]
[uxbox.common.exceptions :as ex]
[uxbox.config :as cfg]
[uxbox.core :refer [system]]
[uxbox.util.redis :as redis]
[uxbox.util.data :as data]
[vertx.util :as vu])
[uxbox.util.redis :as redis])
(:import
java.lang.AutoCloseable))
@ -33,20 +30,20 @@
:stop (.close ^AutoCloseable client))
(defstate conn
:start @(redis/connect client)
:start (redis/connect client)
:stop (.close ^AutoCloseable conn))
;; --- API FORWARD
(defn subscribe
[topic]
(redis/subscribe client topic))
([topic]
(redis/subscribe client topic))
([topic xf]
(redis/subscribe client topic xf)))
(defn run!
[cmd params]
(let [ctx (vu/get-or-create-context system)]
(-> (redis/run! conn cmd params)
(vu/handle-on-context ctx))))
(redis/run! conn cmd params))
(defn run
[cmd params]