Is there a way to be notified when a clojure future finishes?

前端 未结 5 1480
鱼传尺愫
鱼传尺愫 2021-02-04 14:56

Is there a way to set a watch on a future so that it triggers a callback when it is done?

something like this?

> (def a (future (Thread/sleep 1000) \"         


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-04 15:10

    I found this thread on google which looks interesting:

    https://groups.google.com/forum/?fromgroups=#!topic/clojure-dev/7BKQi9nWwAw

    http://dev.clojure.org/display/design/Promises

    https://github.com/stuartsierra/cljque/blob/master/src/cljque/promises.clj

提交回复
热议问题