Keith Bennett <keithrbenn...@gmail.com> writes:

> I'm trying to wrap my head around Clojure's concurrency.  I'm new to
> Lisp-like languages, and the examples that I've found are a bit
> complex.
>
> Can anyone point me to simple examples of how concurrency works in
> Clojure?  (Not just one-liners, but examples that actually modify
> values from multiple threads, and hopefully print out some helpful
> information?

Sure; I created a program called Mire to play with this.

It's a multiplayer text adventure that uses refs to handle concurrent
access to things like who is in which rooms and who can pick up which
items. Since it's just dealing with text, it's still a very simple
codebase (around 200 lines). I think it should be pretty understandable.

https://github.com/technomancy/mire/tree

It's not thoroughly documented, but if you find anything particularly
confusing after reading and trying it out, feel free to ask about it.
The bulk of the functionality is in commands.clj, with some boring
server bits in mire.clj.

It may not be the most idiomatic code as I haven't read that much
Clojure code from other projects, so I'd be happy to get any suggestions
on how to improve that.

-Phil

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to