Fork me on GitHub
#core-async
<
2017-04-25
>
ska10:04:21

Hi. Maybe a stupid question... Are with-redefs and core.async supposed to work well together in Clojure (not ClojureScript)?

ska10:04:46

@brona, like "not at all" or just "not well"?

bronsa10:04:39

it might work in very few scenarios, if you're lucky and the stars align correctly

bronsa10:04:51

so don't use it

ska10:04:57

Background: I wanted to use clj-http-fake to mock some HTTP requests that get done somewhere down the channels...

ska11:04:46

Hm, but binding does work?

bronsa11:04:12

binding should work

bronsa11:04:57

if you're dealing with dynamic vars

ska11:04:06

@bronsa thanks. Then I will try to work with with-fake-routes instead of with-global-fake-routes

bronsa11:04:16

if not, you're out of luck and you'll have to find another solution

joshjones15:04:18

I enjoyed reading this article again, very informative. There is one error in the article though (as a comment at the bottom of the article mentions), that is in the critical part of understanding it: "root value has already been reset back to 0, causing a race condition" .. should be "reset back to 42".

ska18:04:57

@tbaldridge thanks for the pointer. Exactly what I was looking for. I always thought that with-redefs is "stronger" than binding but I did not think about the form having been exited on the main thread already, while the part of the program behind the channel does its thing. And the last time I looked closer (http://clojure-buch.de/html/master_develch2.html#x5-480002.7.4) the :dynamic meta-data was not yet invented. 🙂