processes use virtual threads
This commit is contained in:
parent
6169f4f462
commit
b7f0d17afe
|
@ -9,4 +9,5 @@
|
||||||
:repl-options {:init-ns ludus.core}
|
:repl-options {:init-ns ludus.core}
|
||||||
:main ludus.core
|
:main ludus.core
|
||||||
:profiles {:uberjar {:aot :all}}
|
:profiles {:uberjar {:aot :all}}
|
||||||
|
:jvm-opts ["--enable-preview"]
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,6 +1,16 @@
|
||||||
(ns ludus.process
|
(ns ludus.process
|
||||||
(:require
|
(:require
|
||||||
[ludus.data :as data]))
|
[ludus.data :as data])
|
||||||
|
(:import (java.util.concurrent Executors)))
|
||||||
|
|
||||||
|
(defn thread-factory [name]
|
||||||
|
(-> (Thread/ofVirtual)
|
||||||
|
(.name name 0)
|
||||||
|
(.factory)))
|
||||||
|
|
||||||
|
(set-agent-send-off-executor!
|
||||||
|
(Executors/newThreadPerTaskExecutor
|
||||||
|
(thread-factory "ludus-vthread-")))
|
||||||
|
|
||||||
(def processes (atom {}))
|
(def processes (atom {}))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user