I'd like to call on the collective wisdom of the group to help me with a project I've come up with (partly) for the purpose of understanding Clojure's parallelism & synchronization primitives.
Imagine a library that both creates and accepts network sockets, acting like a simple proxy, forwarding data in both directions. It would provide hooks for intermediate processing of data in both directions. But don't just think "web proxy" -- my main purpose is to allow for better testing of *any* given networking protocol. Specifically, to log the interactions, replay either side of the communication to simulate any system too complicated to mock, do fuzz-testing in the middle of the stream for security testing... that sort of thing. (Simple protocol logging with timestamps is the first task I have in mind.) To better my understanding, I'd like to use a design that requires no explicit main event loop in my code, and exposes me to functional techniques. I suspect the result will look a little like the various libraries such as Ruby's IO::Reactor, Perl's POE, or Python's Twisted. But I also suspect that Clojure's unique features will make this a lot easier. Here's where I'm stuck: I don't quite understand how to use Clojure's parallelization and synchronization primitives for solving this kind of problem -- I understand the designs for ordinary servers quite a lot better than those for proxies. I'd appreciate pointers to documents about this, but I especially want to inspire some discussion of what would be idiomatic clojure for an event-driven asynchronous-I/O application like the one I'm describing. Please help me design! -- Chris Riddoch -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
