On Thu, Dec 18, 2008 at 3:07 PM, Stephan Mühlstrasser
<stephan.muehlstras...@web.de> wrote:
>
> The following is my attempt to start a sub-process and to pass through
> stdout and stderr.  The shell command prints out 1000 lines "hello"
> and a final "command finished". The problem is that nothing is printed
> by the Clojure program. If I increase the number of lines for example
> to 2000 (change "head -1000" to "head -2000"), I see a lot of output,
> but it is cut off somewhere in the middle and the final "command
> finished" does never appear.

This is just a buffering/flushing problem.  Try adding
(.flush ostream) after your (.println ...)

> Is this use of agents incorrect?

Since the action you're sending could block on IO, you should use
'send-off' instead of 'send'.  The difference is that the pool of
threads used by 'send' doesn't grow with demand, so too many blocking
threads could cause new 'send' calls to queue up unnecessarily.

--Chouser

--~--~---------~--~----~------------~-------~--~----~
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