version
0.8.2
platform
macOS 11.6
problem
Getting a Method schedule on class java.util.concurrent.Executors$DelegatedScheduledExecutorService not allowed! message when trying to call schedule on a scheduler.
repro
(import '[java.util.concurrent Executors TimeUnit])
(defn debounce [f delay-ms]
(let [scheduler (Executors/newSingleThreadScheduledExecutor)
task (atom nil)]
(fn []
(let [[old _] (reset-vals! task (.schedule scheduler f delay-ms TimeUnit/MILLISECONDS))]
(when old
(.cancel old true))))))
(def test-fn (debounce #(println "Hi!") 1000))
(test-fn)
(test-fn)
(test-fn)
expected behavior
Prints out "Hi!" once after about a second.
version
0.8.2
platform
macOS 11.6
problem
Getting a
Method schedule on class java.util.concurrent.Executors$DelegatedScheduledExecutorService not allowed!message when trying to call schedule on a scheduler.repro
expected behavior
Prints out "Hi!" once after about a second.