Fork me on GitHub
#calva
<
2021-06-23
>
Zaymon02:06:18

Mucking around with core.async:

(ns try-core-async.hotdog
  (:require [clojure.core.async
             :refer [<! >!! <! go chan]]
            [clojure.tools.logging :refer [info]]))


(def echo-chan (chan))

(go (println (<! echo-chan)))

(>!! echo-chan "ketchup")
When I execute the last line in the repl, it happens once, and then the REPL / calva becomes unresponsive. Does anyone have any insight on this?

Alex Miller (Clojure team)02:06:19

echo-chan is unbuffered (0 length)

Alex Miller (Clojure team)02:06:49

I’m not sure how that relates to the greater env but try it with (chan 1)

Zaymon02:06:17

Ah. Thanks Alex. I was mixing up the behaviour of go and go-loop. Also executing blocking operations in the REPL naturally blocks execution :man-facepalming: (like trying to >!! onto a full channel)

Zaymon02:06:03

The core async API reference is really good. Excited to explore and learn more

Marc O'Morain10:06:26

Does anyone use Kaocha with Calva to run tests? I’m wondering how I should trigger a run of tests in the current namespace using the Kaocha runner. I can run tests with (kaocha.repl/run *ns*), but running “Calva: Run Tests for current namespace” from the command pallet doesn’t run them.

pez10:06:35

The Calva command for this runs the cider test runner. Maybe you can use a custom REPL command for this? https://calva.io/custom-commands/

Marc O'Morain17:06:47

Perfect. I’ll give that a go