Skip to content

Commit 6204788

Browse files
committed
Restore clojure.clr.async.task/run (accidentally deleted)
1 parent e93a2a0 commit 6204788

File tree

1 file changed

+7
-0
lines changed
  • Clojure/Clojure.Source/clojure/clr/async

1 file changed

+7
-0
lines changed

Clojure/Clojure.Source/clojure/clr/async/task.clj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,11 @@
181181
[x]
182182
(instance? Task x))
183183

184+
(defn run
185+
"Runs f (zero-arg fn) on the thread pool. Returns Task<object>.
184186
187+
Usage:
188+
(t/await (t/run (fn [] (+ 1 2 3))))"
189+
[f]
190+
(let [func (gen-delegate |System.Func`1[System.Object]| [] (f))]
191+
(Task/Run func)))

0 commit comments

Comments
 (0)