This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-26
Channels
- # aatree (6)
- # admin-announcements (2)
- # aws (1)
- # beginners (46)
- # boot (341)
- # braid-chat (3)
- # cider (20)
- # clara (1)
- # cljs-dev (3)
- # cljsjs (7)
- # cljsrn (73)
- # clojure (63)
- # clojure-art (4)
- # clojure-dev (3)
- # clojure-russia (83)
- # clojurescript (77)
- # core-async (12)
- # core-matrix (2)
- # cursive (9)
- # data-science (1)
- # datomic (14)
- # dirac (3)
- # emacs (9)
- # hoplon (3)
- # immutant (8)
- # ldnclj (80)
- # luminus (13)
- # mount (7)
- # off-topic (4)
- # om (288)
- # onyx (20)
- # overtone (5)
- # pedestal (10)
- # perun (3)
- # proton (103)
- # quil (1)
- # re-frame (3)
- # reagent (13)
- # ring-swagger (7)
- # yada (43)
@jplaza: there’s also a good example in pedestal-micro https://github.com/rkneufeld/pedestal-micro/blob/master/src/leiningen/new/pedestal_micro/service.clj
Is anybody able to explain
(defroutes route-table
[[["/events" {:get [::events (start-event-stream stream-ready)]}]]])
in : https://github.com/pedestal/pedestal/blob/master/guides/documentation/service-sse.md
Does ::events need to be implemented? or is it just an arbitrary symbol?hey @xlevus. the short answer is that it's an optional part of the routing data structure. see https://github.com/pedestal/pedestal/blob/master/guides/documentation/service-routing.md#verb-maps. ::events is an optional name for that particular route, and see https://github.com/pedestal/pedestal/blob/master/guides/documentation/service-routing.md#route-names for more about route naming.
I keep getting Exception in thread "async-thread-macro-1" java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.util.Locale
whenever I do anything in the function passed to start-event-stream
.
But when I make the body of the function just nil
it seems to work fine, and my browser appears to open the EventStream connection fine.
all well?
yeah, mostly. Can't seem to call Timbre logging functions within anything that's async. but might be another issue altogether
Cool thanks @frankie ! I’m still trying to understand why isn’t this something that comes as part of the library. Or someone builds something on top of pedestal. This is a pretty common use case when developing web apps
jplaza: I think they’ve packaged it under the service-tools https://github.com/pedestal/pedestal/blob/master/service-tools/src/io/pedestal/service_tools/dev.clj