Fork me on GitHub
#clojure
<
2020-05-24
>
Ben Sless14:05:07

If I create a lazy sequence in one thread (A) and pass it to another (B) which iterates over it, can I assume the computation will happen on thread B?

Alex Miller (Clojure team)15:05:45

It’s cached and used from both so it depends

Alex Miller (Clojure team)15:05:08

If A is not iterating, then yes it’s in B

Ben Sless15:05:31

Just what I wanted to know. Thanks 🙂

Alex Miller (Clojure team)15:05:41

The thread that needs an unrealized value will be the one to realize it

👍 4
jrychter16:05:00

Which also means, be careful with your dynamic variables, because they might not be there when the value is realized (this used to bite me when I was beginning to write Clojure, coming from Common Lisp).

Daniel Tan17:05:09

how do you guys do event streaming for Datomic? I just want a web app that displays live data changes with reagent

Daniel Tan01:05:07

they don’t seem to fire events, it’s more like a on-request if I’m understanding this correctly. So I guess I’m supposed to notify some thing that the log has changed and I should update some log cache?

vemv02:05:37

In my previous post I didn't really find the thing I had in mind (that I vaguely remembered) it's the transaction report queue. Seems like this app would map quite well to your original intent (given the frontend focus): https://github.com/waf/push-demo

Daniel Tan16:05:17

thanks, that seems to be what I had in mind as well

MatthewLisp19:05:47

Hello, does anyone happen to have a snippet or something to easily generate mac addresses as strings ?

Daniel Tan01:05:07

they don’t seem to fire events, it’s more like a on-request if I’m understanding this correctly. So I guess I’m supposed to notify some thing that the log has changed and I should update some log cache?