Re: Redirecting Output

2009-10-21 Thread Gorsal
According to this thread http://www.velocityreviews.com/forums/t142870-inputstream-and-selector.html the channel produced from at least the InputStream of system.in is always blocking . probably the same here. oh well... --~--~-~--~~~---~--~~ You received this messa

Re: Redirecting Output

2009-10-21 Thread Gorsal
So, ive been trying this out and it hasn't quite been working out. First, im getting a inputstream from a Process. Then i'm getting a channel from it using Channels/newChannel. This gives me a ReadableByteChannelImpl which claims to implemen tInterruptibleChannel http://www.docjar.org/docs/api/jav

Re: Redirecting Output

2009-10-20 Thread Gorsal
Yep, dual core machine. --~--~-~--~~~---~--~~ 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

Re: Redirecting Output

2009-10-20 Thread Jeffrey Straszheim
Speaking of which, NIO is certainly a subset of Java that would benefit from a nice Clojure wrapper. Not that I'm volunteering or anything. On Tue, Oct 20, 2009 at 3:06 AM, Alex Osborne wrote: > > John Harrop wrote: > > On Tue, Oct 20, 2009 at 12:07 AM, Alex Osborne > >

Re: Redirecting Output

2009-10-20 Thread Alex Osborne
John Harrop wrote: > On Tue, Oct 20, 2009 at 12:07 AM, Alex Osborne > wrote: > > Gorsal wrote: > > However, this raises the CPU to about 50 percent. This is due to the > > infinite recursion, I'm assuming? > > Yes, it's because you're tight looping, chec

Re: Redirecting Output

2009-10-20 Thread John Harrop
On Tue, Oct 20, 2009 at 12:07 AM, Alex Osborne wrote: > Gorsal wrote: > > However, this raises the CPU to about 50 percent. This is due to the > > infinite recursion, I'm assuming? > > Yes, it's because you're tight looping, checking to see if data is > available as fast as possible. A quick and

Re: Redirecting Output

2009-10-19 Thread Alex Osborne
Gorsal wrote: > I'm trying to redirect the input i receive from a BufferedInputStream > to the repl. I'm trying something like this: > > (defmacro with-thread [nm & body] > `(let [thread# (Thread. (fn [] (do ~...@body)))] > (if ~nm (.setName thread# ~nm)) > (.start thread#) > thread#

Re: Redirecting Output

2009-10-19 Thread Gorsal
oh, and jprint is basically equivalent to print --~--~-~--~~~---~--~~ 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 modera

Redirecting Output

2009-10-19 Thread Gorsal
I'm trying to redirect the input i receive from a BufferedInputStream to the repl. I'm trying something like this: (defmacro with-thread [nm & body] `(let [thread# (Thread. (fn [] (do ~...@body)))] (if ~nm (.setName thread# ~nm)) (.start thread#) thread#)) (defn redirect-stream [nm

Redirecting Output

2009-10-19 Thread Gorsal
I'm trying to redirect the input i receive from a BufferedInputStream to the repl. I'm trying something like this: (defmacro with-thread [nm & body] `(let [thread# (Thread. (fn [] (do ~...@body)))] (if ~nm (.setName thread# ~nm)) (.start thread#) thread#)) (defn redirect-stream [nm