Fork me on GitHub

Is anybody able to explain

(defroutes route-table
  [[["/events" {:get [::events (start-event-stream stream-ready)]}]]])
in : 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 ::events is an optional name for that particular route, and see 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.


oh. nope. only happens with timbre. ok.


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