Presumably you're starting your worker processes to avoid the overhead
of starting a new thread each time? In which case, a better solution
may be to use a thread pool instead.
- James
But how do I notify my working threads that the cache was updated? Are
there some (clojure) patterns that I can use?
You're better off falling back to Java for this. Clojure doesn't yet
have a native mechanism for handling streaming data, so the standard
Java stream classes are generally used when dealing with I/O.
However, there are a bunch of helper functions in clojure.java.io that
you'll definitely want to use.
Once you have your stream, you probably want a function like:
(defn read-bytes [stream n]
(let [bytes (byte-array n)]
(.read stream bytes)
bytes))
And then turn it into a string with:
(String. bytes "UTF-8")
- James