Skip to content

Commit

Permalink
Remove now not necessary call to wrap-binding
Browse files Browse the repository at this point in the history
  • Loading branch information
niwinz committed Dec 4, 2023
1 parent 9a82616 commit 839c3f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 8 additions & 10 deletions src/promesa/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,8 @@
"Analogous to `clojure.core.async/thread` that returns a promise
instance instead of the `Future`. Useful for executing synchronous
code in a separate thread (also works in cljs)."
([f] (exec/submit! :thread (exec/wrap-bindings f)))
([executor f] (exec/submit! executor (exec/wrap-bindings f))))
([f] (exec/submit! :thread f))
([executor f] (exec/submit! executor f)))

(defn vthread-call
"A shortcut for `(p/thread-call :vthread f)`."
Expand Down Expand Up @@ -666,18 +666,16 @@
(do
(promesa.exec/run!
:vthread
(promesa.exec/wrap-bindings
~(if (seq names)
`(fn [] (apply ~tsym (:bindings ~res-s)))
tsym)))
~(if (seq names)
`(fn [] (apply ~tsym (:bindings ~res-s)))
tsym))
nil)
(~rsv-s ~res-s)))))))]
(promesa.exec/run!
:vthread
(promesa.exec/wrap-bindings
~(if (seq names)
`(fn [] (~tsym ~@fvals))
tsym))))))))
~(if (seq names)
`(fn [] (~tsym ~@fvals))
tsym)))))))

(defmacro recur
[& args]
Expand Down
2 changes: 1 addition & 1 deletion src/promesa/exec.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@
(delay (thread-factory :prefix "promesa/virtual/" :virtual true))))

#?(:clj
(defn- resolve-thread-factory
(defn resolve-thread-factory
{:no-doc true}
^ThreadFactory
[tf]
Expand Down

0 comments on commit 839c3f0

Please sign in to comment.