This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-25
Channels
- # aleph (9)
- # announcements (2)
- # babashka (32)
- # babashka-sci-dev (72)
- # beginners (77)
- # calva (1)
- # cider (3)
- # clj-kondo (19)
- # clojure (61)
- # clojure-brasil (13)
- # clojure-europe (25)
- # clojure-italy (1)
- # clojure-nl (2)
- # clojure-norway (27)
- # clojure-uk (23)
- # clojuredesign-podcast (6)
- # clojurescript (12)
- # conjure (2)
- # core-typed (3)
- # cursive (6)
- # datalevin (2)
- # datomic (13)
- # emacs (9)
- # events (19)
- # fulcro (6)
- # graphql (11)
- # gratitude (2)
- # helix (3)
- # honeysql (16)
- # jobs (1)
- # lsp (89)
- # malli (33)
- # meander (14)
- # off-topic (87)
- # pathom (4)
- # polylith (7)
- # portal (4)
- # practicalli (1)
- # rdf (6)
- # reagent (2)
- # releases (8)
- # remote-jobs (1)
- # shadow-cljs (59)
- # sql (8)
- # tools-deps (14)
- # xtdb (18)
måning
Good morning in the morning!
anyone seen any prior art around concurrency limiting a function's application ? i need to wrap a function like (limit-conc n f) -> f'
such that f'
can be called just like f
but will limit the concurrent applications of f
...
What shall happen if the limit is reached?
park until some ongoing applications have finished - this is all promise-based, so concurrent-applications is equivalent to unresolved-promises
i think i'll need a queue of requested applications and some structure of active applications
and i need it on both clj+cljs ... and not sure of the best structures off the top of my head
or if i can pick up a lib and avoid writing the code 😬
hmm - that's could be worth a look @U0525KG62 - the structures required may be similar (although claypoole is clj only and explicitly threadpool-based, so i can't actually use it)
It'd submit to a fixed worker pool, for java Executors/newFixedThreadPool
in js maybe some like https://github.com/josdejong/workerpool
You can wrap it with a semaphore then not have to worry about where the function is running
In clojurescript?
giving up on this... i did an implementation, but it wasn't much faster than using a manifold stream with a buffer to control concurrency, and since it's for a streams lib i'm just going to munge streams instead
Good morning 🙂 Sunny and windy here. Looking forward to see the sun wane and be left with cozy, windy darkness 💨