Lamina and channels-driven concurrency with Clojure

307 views
Skip to first unread message

Alexey Kachayev

unread,
Jul 23, 2012, 3:19:04 AM7/23/12
to clo...@googlegroups.com
Hi, everybody!

Rob Pike gave an interesting talk on latest Google I/O "Go Concurrency Patterns" with excellent examples of how to write simple but powerful concurrency code using goroutines and channels (his talk on youtube: http://www.youtube.com/watch?v=f6kdp27TYZs&feature=youtu.be). My idea was to implement the same examples with Clojure and Lamina library which provides event-driven workflow for Clojure (on github: https://github.com/ztellman/lamina/). As the result for this I have two gists:

1. Golang examples from talk - https://gist.github.com/3124594
2. Clojure analog - https://gist.github.com/3146759

Several things was implemented using different approach from origin, cause of different paradigms and workflows. But I think, that in general, this code blocks can act both as basic for article about channels-driven concurrency with Clojure (which I plan to write in nearest future) and good addition to Lamina-project's documentation.  Unfortunately I didn't find enough documentation for Lamina project (in general library is great, but some things are not straightforward and hard to use without examples/clarifications). 

I didn't use such approach for concurrency programming yet, so I want to ask community to check/review/update code in terms of best practices. I know that there are some problems, which possible can be resolved in more efficient/beautiful way (there are several TODOs in comments). I would greatly appreciate any comments/ideas/suggestions on how to make this code better.

P.S. Please, note that main (and most "powerful") example is "Google Search" - https://gist.github.com/3146759#file_clojure_channels_7_search.clj (for both gists). Other examples are just preparing to main one :) 

--
Kind regards,
Alexey S. Kachayev, CTO at KitApps, Inc.
----------
Twitter: @kachayev
Skype: kachayev
Tel: +380-996692092
Reply all
Reply to author
Forward
0 new messages