[kepler-dev] Combining the CommandLine and Exec actors
Dan Higgins
higgins at nceas.ucsb.edu
Fri Jun 17 09:40:36 PDT 2005
Hi Bilsay,
I think you summarized things very well. I only have a few minor comments.
The I/O threads (gobblers) were borrowed (I think) from an article in
JavaWorld; they were added specifically for Windows since apparently the
internal buffers used by the Windows commandline/shell were too small
and often overflowed. They are probably not needed for Unix systems (and
maybe not even for the latest versions of Windows). It is probably still
a good idea to use them to avoid problems.
Being able to connect to an input stream is often very useful. So
including that capability, as you suggest is a good idea in my opinion.
Finally, one option that I don't think we have considered in Exec or
CommandLine is to launch a process and NOT wait for it to complete.
(Currently I think we always use a 'waitFor()' method). This would be
primarily of use for launching completely different applications for
output/display at the end of a Kepler workflow. There are some occasions
when this would be useful.
Good luck on your efforts!
Dan Higgins
bilsay at sdsc.edu wrote:
>Hi,
>
>I am Bilsay,I am working with Ilkay as an intern and I was looking to find
>a way to combine the CommandLine and Exec actors.I read the discussions
>about this issue and I know that you are familiar to it.I would like to
>share some ideas and hopefuly get some feedback and ideas from you.
>
> Both CommandLine an Exec have their own features for executing a command.
>The idea is to implement an actor which will combine the pluses of each
>actor because that they have lots in common.
>Exec launches a subprocess directly while CommandLine uses the shell. The
>main difference seems to be this. Exec has some special and useful
>parameters like environment and directory .It also has an input port to
>get standard input to the process. Because that it doesn’t use the shell
>there are threads (gobblers) which are involved in giving output and
>error. But it can’t be used for I/O direction. CommandLine seems to be
>handier in more conditions because it uses the shell. Combining them over
>CommandLine would be easier because of that.
>
>Combination should have (additional to CommandLine):
>
>• environment and directory parameters
>• An input port for input stream
>• Threads(Gobblers) to handle output and error.
>
>Environment and directory parameters:
>
>I think it would be useful if we were able to set environment and the
>directory of execution. So they should be in the combined actor.
>
>An input port for input stream:
>
> The combined actor could have a port for standard I/O and this could be
>buffered and given to the process as its’ input. CommandLine can take
>arguments,input file path,output file path(which actually it doesn’t have
>it but I think it could be given from the port, just like input file),
>but not standard I/O. Now it would see much like an extended version of
>Exec.
>
>Threads(Gobblers) to handle output and error.
>
> Actually when it uses the shell there shouldn’t be any problems but
>practically it seems that there are. For this reason the gobblers in Exec
>would be useful to use. Output and Error messaging can be handled by
>using gobblers.
>
>
>Basically these are which comes up to my mind. I am open to every
>suggestion or comment. Because there might have been things which I have
>misunderstood or forgotten.
>
>
>Bilsay Yildirim
>
>
--
*******************************************************************
Dan Higgins higgins at nceas.ucsb.edu
http://www.nceas.ucsb.edu/ Ph: 805-893-5127
National Center for Ecological Analysis and Synthesis (NCEAS)
Marine Science Building - Room 3405
Santa Barbara, CA 93195
*******************************************************************
More information about the Kepler-dev
mailing list