This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-03
Channels
- # announcements (63)
- # asami (29)
- # beginners (23)
- # calva (23)
- # cider (18)
- # clj-kondo (12)
- # clojure (156)
- # clojure-europe (30)
- # clojure-italy (6)
- # clojure-nl (5)
- # clojure-uk (6)
- # clojurescript (14)
- # conjure (26)
- # cursive (8)
- # datalog (143)
- # datascript (1)
- # datomic (6)
- # duct (2)
- # emacs (50)
- # events (4)
- # figwheel-main (6)
- # fulcro (7)
- # graphql (12)
- # jobs (6)
- # malli (1)
- # mid-cities-meetup (2)
- # off-topic (4)
- # pathom (6)
- # portal (7)
- # re-frame (10)
- # reagent (8)
- # reitit (10)
- # releases (1)
- # reveal (18)
- # shadow-cljs (39)
- # sql (4)
- # tools-deps (36)
- # vim (25)
- # xtdb (6)
In https://github.com/metosin/reitit/blob/master/doc/ring/compiling_middleware.md, the example middleware returns a fn with two different arities; one on the form [request]
, and one on the form [request respond raise]
. What determines which of these is used? Do I need to implement both, or can I pick one?
@wombawomba Ring async uses the 3-arity version. You can call your app with 1 or 3 args, arity is retained through the call chain and it throws ArityError
etc. if some component (mw or handler) doesn't support it.
Alright, thanks! I’m not familiar with async mode, but I’ll take a look. You wouldn’t happen to know if running Ring in async mode is common/recommended?
mostly not needed. reitit-http
should be run in async mode as any step/interceptor can return promise, async channel etc. running it in stnc-mode causes all those to block.
if you use jdbc-pooling, it's anyway blocking the thread. The async-db libs are not that great in clj.
Cool, thanks for the info 🙂