This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-25
Channels
- # aleph (12)
- # announcements (2)
- # beginners (40)
- # calva (8)
- # cider (26)
- # cljs-dev (71)
- # cljsrn (2)
- # clojure (122)
- # clojure-dev (9)
- # clojure-europe (2)
- # clojure-nl (2)
- # clojure-spec (42)
- # clojure-uk (20)
- # clojurescript (86)
- # cursive (15)
- # data-science (1)
- # datomic (42)
- # duct (4)
- # emacs (33)
- # events (1)
- # figwheel-main (2)
- # fulcro (33)
- # jobs (2)
- # jobs-discuss (46)
- # kaocha (13)
- # leiningen (9)
- # off-topic (62)
- # pathom (75)
- # quil (2)
- # re-frame (6)
- # reagent (13)
- # reitit (3)
- # shadow-cljs (52)
- # spacemacs (3)
- # specter (17)
- # sql (6)
- # tools-deps (2)
- # vim (3)
- # yada (28)
I think the idiomatic way to cancel something in Manifold is to resolve appropriate deferred with an error (this would short-circuit all chained callbacks). If you also want to cancel some long running computation: give it deferred to put the result into and make it check periodically if deferred is still in not-realized state (see latest update for d/loop
for example)
https://github.com/ztellman/manifold/issues/166 (I thought that was a PR, but that was an issue, sorry for confusion)
so currently it’s not well supported? say I have a future:
(def f (future
(println "1")
(Thread/sleep 10000)
(when-not (Thread/interrupted)
(println "2")
(Thread/sleep 10000)
(when-not (Thread/interrupted)
...))))
(do (Thread/sleep 5000) (future-cancel f))
;; 2 is never printed
How is this translated to manifold? I think it would be worth having this example in the READMEIt’s not supported for deferred/loop right now, but the approach described in the issue I’ve mention is what you’re looking for. Let me put a gist for you