This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-30
Channels
- # aws (1)
- # bangalore-clj (2)
- # beginners (64)
- # boot (29)
- # cider (4)
- # clara (14)
- # cljsjs (22)
- # cljsrn (24)
- # clojure (248)
- # clojure-austin (5)
- # clojure-berlin (1)
- # clojure-china (5)
- # clojure-france (1)
- # clojure-greece (1)
- # clojure-italy (2)
- # clojure-korea (6)
- # clojure-russia (76)
- # clojure-spec (2)
- # clojure-uk (59)
- # clojurescript (67)
- # cursive (12)
- # datascript (6)
- # datomic (126)
- # defnpodcast (2)
- # devcards (1)
- # docker (1)
- # events (2)
- # hoplon (14)
- # leiningen (1)
- # luminus (2)
- # midje (2)
- # mount (1)
- # off-topic (4)
- # om (6)
- # onyx (8)
- # parinfer (2)
- # perun (6)
- # proton (5)
- # re-frame (41)
- # reagent (6)
- # ring-swagger (3)
- # rum (1)
- # spacemacs (10)
- # specter (12)
- # yada (25)
@bbss :
(:require [aleph
[http :as http]
[netty :as netty]]
[bidi.ring :as bidi]
...
(let [http-server (http/start-server
(bidi/make-handler api)
(::http config))]
(netty/wait-for-close http-server)))
my initial approach is to have a method :response that publishes a command on an event server and then waits for the event signalling the resource creation
… but am wondering if it would be more idiomatic to tie the publish / look up resource events into the yada lifecycle
I’ve gone back and forth over the docs and can’t determine simple places to hook in so maybe the first approach is more idiomatic 😉
If you can get the first approach to work that would be better. Only because yada's interceptors are designed to work in a linear ordered sequence, which took a long time to refine. It's generally OK to add interceptors, but not much more than that
yada 2.0 has a more 'monadic' design to the interceptor chain and it will be possible to add all kinds of user-provided instrumentation adaptors etc.
e.g. for dev, your interceptors get more instrumented and the context is captured (for inspection) between each interceptor
there is also a concept of profiles, so you can run the yada resource in different profiles (e.g. for dev and prod), which helps to balance trade-offs between raw performance, security and debuggability.
great stuff, thanks @malcolmsparks … once I got my head around the ctx I was good to go
@malcolmsparks does that allow for metrics capturing like in Zach's talk about the pumpkin carvers? 🙂
but yada 2.0 is some way off, and even when I release it it will be some time before it gets to the feature-list of 1.1.x
I'll still be supporting 1.1.x for a long time yet
can I avoid this Cannot JSON encode object of class: class java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: No implementation of method: :charset of protocol: #'yada.charset/Charset found for class: java.lang.String
?
the problem with these is that the stacktrace of the original error is no longer available in the server log
Would it be possible to use something like this in yada https://github.com/yeller/clojure-miniprofiler ?