reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
wombawomba 2020-08-03T10:08:42.396700Z

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?

ikitommi 2020-08-03T11:35:20.400500Z

@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.

ikitommi 2020-08-03T11:36:24.402300Z

web servers like ring-jetty have option to start the server in async mode.

wombawomba 2020-08-03T11:38:34.404200Z

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?

ikitommi 2020-08-03T11:42:19.406700Z

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.

ikitommi 2020-08-03T11:43:09.408100Z

if you use jdbc-pooling, it's anyway blocking the thread. The async-db libs are not that great in clj.

ikitommi 2020-08-03T11:44:00.408700Z

metosin/porsas is so pre-alpha 🐖

wombawomba 2020-08-03T11:45:43.409400Z

Cool, thanks for the info 🙂

ikitommi 2020-08-03T14:59:30.413600Z

someone asked about #malli get-in walking over :and schemas. About to close a PR which will add utilities for doing that and much more. Getting closer to release.

ikitommi 2020-08-03T14:59:36.413700Z

https://github.com/metosin/malli/pull/238