This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-15
Channels
- # admin-announcements (130)
- # alternate-reality (2)
- # aws (20)
- # beginners (49)
- # boot (1)
- # braid-chat (18)
- # cljsrn (54)
- # clojars (1)
- # clojure (70)
- # clojure-art (1)
- # clojure-japan (21)
- # clojure-miami (2)
- # clojure-my (7)
- # clojure-russia (60)
- # clojurescript (75)
- # community-development (12)
- # core-matrix (7)
- # cursive (23)
- # datomic (31)
- # dirac (2)
- # dunaj (3)
- # dysphemism (5)
- # editors-rus (1)
- # emacs (22)
- # events (9)
- # funcool (56)
- # hoplon (63)
- # human (1)
- # jobs (9)
- # ldnclj (7)
- # lein-figwheel (21)
- # leiningen (1)
- # off-topic (2)
- # om (61)
- # onyx (20)
- # other-lisps (2)
- # portland-or (1)
- # proton (26)
- # re-frame (27)
- # reagent (16)
- # ring-swagger (30)
- # spacemacs (6)
- # yada (5)
@niwinz: Right. The problem with those solutions is that they both put the static assets under route. I do not want the assets to be under a route. I want the static assets to be located at / or the root.
In any case just now I'm doing some work in cartacumba so I'm going to create a test case for that
@kenny: https://github.com/funcool/catacumba/commit/6525077b2851403fb6bb86cf88e8b18a2ecc47ec
The catacumba 0.11.x will expose a simple way to serve yourself files in a efficient way 😉
hmm postal socket is just a normal websocket with simple encode/decode middleware, and websockets expose a ctrl channel that can be listen for client close messages
Maybe in the future on-error and on-close functions can be passed to the postal socket
function ?
(defn subscribe-to-events
{:handler-type :catacumba/websocket}
[{:keys [in out ctrl]}]
(let [ch (ws/subscribe)]
(go-loop []
(let [[v p] (a/alts! [ctrl ch in])]
(cond
;; RECEIVING MESSAGES FROM FRONT
(= p in)
(do ws/dispatch v)
;; NORMALLY CAUSE FRONT HAS CLOSED
(= p ctrl)
(do
(println "closed")
(a/close! ch))
;; SENDING MESSAGES TO SUBSCRIBERS
(= p ch)
(do
(>! out v)
(recur)))))))
https://github.com/funcool/catacumba/blob/master/examples/postal-chat/src/clj/compchat/core.clj#L59
As far as I can see, you are using postal, I really appreciate some feedback/comments/opinons about it 😛
I really like the higher level of abstraction so I don't need to worry about the nitty gritty parts of client-server communication
I also really like the stream model. Have you considered writing a version of beicon for clj so that you can use streams on both sides of the postal api?
In client side, streams are used because backpressure in js is not very important (and ws does not has clear access for proper handling it)
but is more "complicated" in term of syntax handle properly backpressure with streams in backend