This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-18
Channels
- # aws (1)
- # babashka (35)
- # beginners (52)
- # biff (4)
- # calva (55)
- # cider (19)
- # clojure (54)
- # clojure-dev (3)
- # clojure-europe (23)
- # clojure-nl (1)
- # clojure-norway (3)
- # clojure-uk (2)
- # clojurescript (9)
- # code-reviews (3)
- # datahike (1)
- # fulcro (1)
- # funcool (4)
- # graalvm (21)
- # gratitude (2)
- # java (5)
- # jobs (2)
- # joyride (1)
- # kaocha (13)
- # malli (2)
- # off-topic (22)
- # other-languages (11)
- # pathom (4)
- # re-frame (35)
- # reagent (3)
- # reitit (3)
- # releases (2)
- # remote-jobs (1)
- # rum (1)
- # shadow-cljs (42)
- # sql (18)
- # tools-deps (72)
- # web-security (6)
- # xtdb (15)
The new CSP features are pretty exciting — I had mostly stayed away from core async because of things like needing to worry about accidentally blocking inside a go loop.
A couple questions:
• It looks like JDK 19 vthreads are not required, since there’s a fallback to p/thread
, is that right? (Obviously the latter is not as lightweight)
• The docs say “The promesa channel and csp patterns implementation do not intend to be a replacement for core.async; and there are cases where https://github.com/clojure/core.async is preferable”
◦ Are these cases only where the vthreads are not available?
• WRT to CLJS not currently being supported, is the recommendation there just to stick with core.async?
Hello @U02SPB5Q6A3 Lets try to answert your questions: 1. Yep, the vthread is not hard requirement, but is a nice-to-have, the standard platform threads are used as fallback. 2. core.async right now has more patterns and helpers than promesa, and promesa does not intends to have solution for all the user cases of core.async. 2b: i gues noup, I mean, the promesa csp module is pretty usable in real world without vthreads. I have tested (and greatly surprised) that I have been able have 15k real platform threads running without blowing the memory; so there are cases where the absence of vthreads is not real problem. Obviously if you want to have 1M of them, or is latency sensitive on spawning a huge amount of short living real platform threads, probably you will need to stick with core async.. 3. cljs is not supported because of two main reasons: cljs does not benefit of using blocking operations so you will be limited to the already existing syntax helping macros that promesa provide for working with asyncronous code; and the second reason is because I don't really need it, personally I think channel implementation is not very usefull on frontend code (i will explain and put better references on the upcoming blogpost). It can be implemeted, but depends in the real interest on having it, and with the obvious first limitation that I have comented... I have developed it with initial target on using it on backend (my own first use case is replace all the websocket realted core.async code with more simpler approach using vthreads on penpot project where core.async is used right now extensivelly on the background tasks and websockets code)