Skip to content

Commit

Permalink
Add minor cosmetic improvements structured-task-scope related code
Browse files Browse the repository at this point in the history
  • Loading branch information
niwinz committed Oct 18, 2023
1 parent 93c1a4a commit 01408c8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/promesa/exec.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
(declare scheduled-executor)
(declare current-thread-executor)


#?(:clj (declare thread-factory))
#?(:clj (declare thread-per-task-executor))
#?(:clj (declare vthread-per-task-executor))
Expand Down Expand Up @@ -344,11 +343,11 @@

#?(:clj
(defonce default-thread-factory
(delay (thread-factory :prefix "promesa/default/"))))
(delay (thread-factory :prefix "promesa/platform/"))))

#?(:clj
(defonce default-vthread-factory
(delay (thread-factory :prefix "promesa/default/" :virtual true))))
(delay (thread-factory :prefix "promesa/virtual/" :virtual true))))

#?(:clj
(defn- resolve-thread-factory
Expand All @@ -359,6 +358,7 @@
(nil? tf) nil
(thread-factory? tf) tf
(= :default tf) @default-thread-factory
(= :platform tf) @default-thread-factory
(= :virtual tf) @default-vthread-factory
(map? tf) (thread-factory tf)
(fn? tf) (reify ThreadFactory
Expand Down Expand Up @@ -846,15 +846,13 @@

pt/IExecutor
(-exec! [it task]
(.fork ^java.util.concurrent.StructuredTaskScope it
^Callable task)
(.fork ^java.util.concurrent.StructuredTaskScope it ^Callable task)
nil)
(-run! [it task]
(.fork ^java.util.concurrent.StructuredTaskScope it ^Callable task))
(-submit! [it task]
(.fork ^java.util.concurrent.StructuredTaskScope it ^Callable task)))))


;; #?(:clj
;; (defn managed-blocker
;; {:no-doc true}
Expand Down

0 comments on commit 01408c8

Please sign in to comment.