This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-02
Channels
- # announcements (11)
- # aws (2)
- # babashka (42)
- # beginners (26)
- # calva (17)
- # cider (1)
- # clara (2)
- # clj-kondo (44)
- # clojars (30)
- # clojure (43)
- # clojure-australia (6)
- # clojure-europe (29)
- # clojure-gamedev (4)
- # clojure-greece (1)
- # clojure-nl (4)
- # clojure-spec (4)
- # clojure-uk (6)
- # clojurescript (28)
- # cursive (16)
- # data-science (1)
- # datahike (4)
- # datomic (26)
- # emacs (6)
- # events (3)
- # fulcro (11)
- # graalvm (7)
- # holy-lambda (118)
- # java (9)
- # jobs (1)
- # leiningen (3)
- # lsp (21)
- # luminus (2)
- # malli (13)
- # membrane-term (1)
- # music (1)
- # nrepl (3)
- # off-topic (38)
- # pedestal (2)
- # polylith (39)
- # re-frame (33)
- # reagent (7)
- # releases (1)
- # remote-jobs (4)
- # rewrite-clj (28)
- # ring (21)
- # sql (2)
- # tools-deps (23)
- # vim (4)
- # xtdb (15)
I'm rewriting an app with synchronous handlers to be async, and I don't want to have to rewrite all my endpoint handlers to be async. Is there an async->sync middleware somewhere that I can put at the top of my middleware stack to handle this?
It's a bit difficult to know which happen before and which happen after the handler without some analysis. If you do know then you can write a "translator"
@U15RYEQPJ maybe a silly question - but why are you rewriting your app to be async
And then the follow up is - the model that lets you work with async code the same as sync code is the interceptor model
Pedestal does this, there might be some library that implements it separately, but that is the way
Because making an async->sync middleware would probably negate whatever benefit you hoped to get from being async otherwise
oh whoops, missed this
I went ahead and wrote an async->sync middleware, which worked
anyway, the idea is to eventually get rid of it and make everything async
the main point in making things async would be to prevent requests from hogging threads
oh, cool
not sure when that feature will land though?
also, it seems like I'd have to wait for my webserver (Jetty) to support it
> A preview feature is a new feature whose design, specification, and implementation are complete, but which is not permanent, which means that the feature may exist in a different form or not at all in future JDK release
https://webtide.com/do-looms-claims-stack-up-part-2/ https://github.com/eclipse/jetty.project/issues/5078
oh, neat