Fork me on GitHub
#core-async
<
2017-01-22
>
serioga14:01:41

> And that's a 1-time kind of thing but takers can take value many times

(require '[clojure.core.async :as a])
=> nil
(def ch (a/promise-chan))
=> #'user/ch
(a/put! ch 42)
=> true
(a/close! ch)
=> nil
(a/<!! ch)
=> 42
(a/<!! ch)
=> 42
(a/<!! ch)
=> 42

tianshu16:01:56

how to stop a go block in repl?

tianshu16:01:46

If I have a component that consume the message from publication, when the component start, a go-loop will be start. If I want to stop the component, I should send a special :msg-type that stands for STOP signal?

serioga16:01:00

@doglooksgood write a loop which exits if reading from channel returns nil (or writing to channel returns false) then you can stop a loop by closing this channel

val_waeselynck21:01:13

@doglooksgood using an atim works fine too.