Fix license, bump deps

master
Jure Podgoršek 2018-08-07 16:44:39 +02:00
parent 79fc04f4d9
commit d421a03cc1
3 changed files with 12 additions and 12 deletions

View File

@ -2,7 +2,7 @@
:description "interactive visualization" :description "interactive visualization"
:url "https://kreten.si" :url "https://kreten.si"
:license {:name "GNU Affero General Public License" :license {:name "GNU Affero General Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"} :url "https://www.gnu.org/licenses/agpl-3.0.en.html"}
@ -12,8 +12,8 @@
[org.clojure/clojurescript "1.10.312"] [org.clojure/clojurescript "1.10.312"]
[org.clojure/core.async "0.4.474"] [org.clojure/core.async "0.4.474"]
[jarohen/chord "0.8.1"] [jarohen/chord "0.8.1"]
[ring "1.4.0"] [ring "1.7.0-RC1"]
[compojure "1.5.0"]] [compojure "1.6.1"]]
:plugins [[lein-figwheel "0.5.16"] :plugins [[lein-figwheel "0.5.16"]
[lein-cljsbuild "1.1.7" :exclusions [[org.clojure/clojure]]]] [lein-cljsbuild "1.1.7" :exclusions [[org.clojure/clojure]]]]

View File

@ -140,7 +140,5 @@
(.addEventListener js/window "resize" on-window-resize false) (.addEventListener js/window "resize" on-window-resize false)
(.addEventListener js/window "click" (fn [] (.addEventListener js/window "click" (fn []
(console.log "kleek") (go []
(console.log @vtic) (>! @vtic "ping"))))
(go-loop []
(>! @vtic "WAT"))))

View File

@ -5,8 +5,8 @@
[ring.middleware.reload :refer [wrap-reload]] [ring.middleware.reload :refer [wrap-reload]]
[chord.http-kit :refer [with-channel]] [chord.http-kit :refer [with-channel]]
[org.httpkit.server :refer [run-server]] [org.httpkit.server :refer [run-server]]
[clojure.core.async :refer [chan <! >! put! close! go go-loop]] [clojure.core.async :refer [chan <! <!! >! put! close! go go-loop]]
[clojure.core :refer [string]])) [clojure.string :as str]))
(defn socket-handler [request] (defn socket-handler [request]
(let [cid (java.util.UUID/randomUUID)] (let [cid (java.util.UUID/randomUUID)]
@ -17,11 +17,13 @@
(>! ws-ch (str "Hello " cid)) (>! ws-ch (str "Hello " cid))
(go-loop [] (go-loop []
(let [{:keys [message]} (<! ws-ch)] (let [{:keys [message]} (<! ws-ch)]
(let [[cmd & args] (split message #":")] (println "GOT MSG!" message)
(let [[cmd & args] (str/split message #":")]
(println "command" cmd "(" args ")")
(condp = cmd (condp = cmd
"ping" (>! ws-ch "pong") "ping" (>! ws-ch "pong")
"echo" (>! ws-ch (str "pong" args))
(println "Dunno what to do with command " cmd))) "Unknown command :/"))
(recur)))))))) (recur))))))))
;;(close! ws-ch))))) ;;(close! ws-ch)))))