This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-22
Channels
- # announcements (2)
- # asami (123)
- # aws (17)
- # babashka (77)
- # babashka-sci-dev (23)
- # beginners (48)
- # biff (6)
- # calva (35)
- # cider (16)
- # clj-on-windows (1)
- # clj-yaml (19)
- # clojure (36)
- # clojure-europe (78)
- # clojure-nl (5)
- # clojure-norway (8)
- # clojure-poland (3)
- # clojure-uk (16)
- # clojurescript (17)
- # cursive (6)
- # datahike (3)
- # datalevin (26)
- # duct (7)
- # emacs (41)
- # events (2)
- # fulcro (7)
- # graphql (5)
- # honeysql (13)
- # juxt (3)
- # kaocha (7)
- # lsp (5)
- # malli (12)
- # off-topic (14)
- # pathom (3)
- # portal (1)
- # rdf (9)
- # reitit (3)
- # remote-jobs (2)
- # shadow-cljs (37)
- # spacemacs (5)
- # tools-build (1)
- # tools-deps (20)
- # xtdb (2)
@borkdude in order to run (set! clojure.lang.Agent/soloExecutor (Executors/newVirtualThreadPerTaskExecutor))
on the loom bb I need to add Agent.soloExecutor to the reflection config? this is to make (future ...)
calls use virtual threads.
but it's already there: https://github.com/babashka/babashka/blob/aa0da8f503534b1e620284da719af5af6ed4a511/src/babashka/impl/classes.clj#L135
ah right
will try in a bit
given the code
(import '[clojure.lang Agent]
'[java.util.concurrent Executors])
(set! (.-soloExecutor Agent) (Executors/newFixedThreadPool 10))
gives the error
----- Error --------------------------------------------------------------------
Type: clojure.lang.ExceptionInfo
Message: Invalid assignment target
Data: {:type :sci/error, :line 4, :column 1, :file "/Users/rahul.de/code/expts/clojure/foo.clj", :phase "analysis"}
Location: /Users/rahul.de/code/expts/clojure/foo.clj:4:1
Phase: analysis
----- Context ------------------------------------------------------------------
1: (import '[clojure.lang Agent]
2: '[java.util.concurrent Executors])
3:
4: (set! (.-soloExecutor Agent) (Executors/newFixedThreadPool 10))
^--- Invalid assignment target
----- Stack trace --------------------------------------------------------------
user - /Users/rahul.de/code/expts/clojure/foo.clj:4:1
this is using the released bb, not the jdk19 oneright
I thought I fixed something around this recently but can't remember exactly what it was
i'll try to poke around
Ah that was only "getting": https://github.com/babashka/sci/commit/5247b866deeec858480ba2bb22a7d0d3b96c0190
well its either this or clojure releases a new version to support loom 😛
> https://github.com/babashka/sci/commit/5247b866deeec858480ba2bb22a7d0d3b96c0190 looking at this, it seems to read a field from an object whereas the above code uses a static public field. would the access pattern for a static field be similar to a non static one?
ah i see (if (and (not (Modifier/isStatic mod)) ...
maybe i could try to have a go at it, since it doesnt seem to be too urgent 😄