An asynchrononous TCP echo client/server in Clojure using Java 7 NIO.2.
https://github.com/bluemont/clj-async-tcp-echo-nio.2

As I've been diving into async libraries in Java and Clojure, I thought it
would be nice to make a simple example with the Java 7 NIO.2 async classes.
I'm sure there is room for improvement, so please let me know if you have
feedback or suggestions.

I find this Clojure version easier to follow than existing Java examples,
largely because `proxy` makes the callbacks more compact.

I intentionally kept the callbacks at the top-level, thus avoiding a lot of
nesting, which led to some minor callback hell. The scoping is clearer that
way, even if the program flow is not. I would expect that different people
would have different preferences.

I would be interested to see other ways of handling it (like core.async,
perhaps?).

--
David James
http://bluemontlabs.com

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to