Fork me on GitHub
#core-async
<
2022-11-02
>
Benjamin10:11:59

Hello,

(a/go (slurp ""))
let's say I slurp a big file - will this consume my go threads? How do I write it in a way that will park the go thread?

Ben Sless10:11:39

Wrap it in a thread and parking take from it

Benjamin10:11:01

(a/go (a/<! (a/thread (slurp ""))))
this you mean?

Ben Sless10:11:14

Exactly

✍️ 1
dpsutton11:11:16

Don’t think you need the go and the <! Since a/thread returns a channel with the value already

Benjamin12:11:20

I suppose the assumption was that there is more code inside the go block. I am now indeed just doing a/thread . Guessing there is virtually no difference between that and future .. ?

Ben Sless12:11:53

Future returns a deref-able thing, thread returns channel

👍 1