|
ToDo:
|
久しぶりに呑んだ。
(ns asynctimeout.core (:require [clojure.core.async :as a :refer [<!! timeout go]]) (:gen-class)) (defn bigjob[] (loop [i 0] (Thread/sleep 100) (println "loop=" i) (recur (inc i)))) (defn -main[& args] (let [t (timeout 1000)] (go (bigjob)) (<!! t) (println "Timeout")))