
Go Concurrency Patterns ported to Clojure - olenhad
https://gist.github.com/danneu/5941767
======
_halgari
Using Thread/sleep inside of a go block is questionable. Using >!! and <!!
inside a go block is simply wrong. Please switch to <! and >! and if you
aren't simulating actual work, remove Thread/sleep. Failing to do so can
seriously mess with the core.async thread pool.

Doing blocking operations inside a go is a anti-pattern.

~~~
ryanbrush
Understanding that core.async is new and evolving, but is there a reference or
an idiomatic way to work with blocking operations, beyond the general advice
of separate threads as an exercise for the reader?

EDIT: I bring this up because this seems like a common misstep for users of
core.async, and a simple pattern for blocking IO might help people avoid it.

core.async really looks awesome...if we can create simple patterns for working
with blocking operations, it would be a compelling model for a lot of use
cases.

(Also, hats off to the core.async developers; it seems like the reward for
creating something great is just demand for more. ;)

~~~
_halgari
I'm working on that right now, but it won't be out till the end of the year.
I'm giving a talk at Clojure/Conj about core.async and hope to cover most of
these sort of questions. I'd publish notes about it now, but that'd kind of
kill my talk in two months.

~~~
ryanbrush
Sounds great. I'm glad to know something like that's in progress, and many
thanks for your efforts on this project!

------
danneu
Haha, I had a double-take when I clicked the link.

I didn't mean to misrepresent core.async. I just heard about it one day and
got compelled enough by a walkthrough[1] to convince myself I could figure
enough of it out to make something happen in my nrepl buffer. Which happens to
also describe my approach to life now that I think about it. Except, you know,
in my life buffer.

[1]:
[https://github.com/clojure/core.async/blob/master/examples/w...](https://github.com/clojure/core.async/blob/master/examples/walkthrough.clj)

