Last active
November 12, 2020 14:14
-
-
Save marcoy/983b8b346ed9ecc4a55a to your computer and use it in GitHub Desktop.
Revisions
-
marcoy renamed this gist
Jun 8, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
marcoy renamed this gist
Jun 8, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
marcoy revised this gist
Jun 8, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ ;; http://stackoverflow.com/questions/18779296/clojure-core-async-any-way-to-control-number-of-threads-in-that-go-thread (ns sandbox (:require [clojure.core.async.impl.concurrent :as conc] [clojure.core.async.impl.exec.threadpool :as tp] -
marcoy created this gist
Jun 8, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ (ns sandbox (:require [clojure.core.async.impl.concurrent :as conc] [clojure.core.async.impl.exec.threadpool :as tp] [clojure.core.async :as async])) (defonce my-executor (java.util.concurrent.Executors/newFixedThreadPool 1 (conc/counted-thread-factory "my-async-dispatch-%d" true))) (alter-var-root #'clojure.core.async.impl.dispatch/executor (constantly (delay (tp/thread-pool-executor my-executor)))) (async/go (println (Thread/currentThread))) ;=> #<Thread Thread[my-async-dispatch-1,5,main]>