Skip to content

Commit

Permalink
fix: fails to eval/compile on JVM version <19
Browse files Browse the repository at this point in the history
  • Loading branch information
armed committed Jun 5, 2024
1 parent 58459f4 commit 66c28b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/k16/ok_http.clj
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@
(let [client-builder (OkHttpClient$Builder.)
dispatcher' (or dispatcher
(when virtual-threads-available?
(Dispatcher. (Executors/newVirtualThreadPerTaskExecutor))))]
(-> Executors
(.getMethod "newVirtualThreadPerTaskExecutor"
(into-array Class []))
(.invoke nil (into-array []))
(Dispatcher.))))]
(set-options! client-builder (assoc options :dispatcher dispatcher'))
(.build client-builder))))

Expand Down

0 comments on commit 66c28b6

Please sign in to comment.