-
-
Save ztellman/983425 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn handler [chi cho] | |
(let [parse (fn-match ([["GETT" ?gid ?uid]] | |
(if-let [v ((data gid) uid)] | |
(str v) | |
(str "ERROR_" gid "_" uid))) | |
([["STOP_SESSION"]] (close chi)) | |
([["STOP"]] (System/exit 0)))] | |
#_ (receive-all chi #(enqueue cho (str "You said: " % "\r\n"))) | |
(siphon (map* #(parse (re-seq #"\S+" %)) chi) cho))) | |
(defn shandler [ch _] (handler ch ch) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment