zhuangxm/clj-rpc — comment on commit 7c46514fc34da66d73822f39f8275c9888678498
File: src/clj_rpc/user_data.clj line 73
By robertluo:

java.util.concurrent.ScheduledExecutorService 是专门做这些定期工作的。

```clojure
(import '[java.uitl.concurrent Executors TimeUnit])

(defn periodical-clean-data! [interval timeout]
(let [scheduler (Executors/newScheduledThreadPool 1)
todo (fn [] (swap! atom-user-datas clean-timeout-data (now) timeout))]
(.schedule scheduler todo interval TimeUnit/MILLISECONDS)))
```