-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Derick Rethans wrote:
[... snip ...]
>> The SystemProcess component needs to fulfill the following
>> requirements from the current point of view:
>> 
>> Execution ---------
>> 
>> - Provide an easy but yet effective way of executing external
>> processes, retrieving their output after they finished.
>> (Synchronous execution)
>> 
>> - Provide means to read from the file descriptors (STDOUT, STDERR,
>> custom descriptors) an executed process provides during while it is
>> currently running. (Asynchronous execution)
>> 
>> - Provide a string representation of the built shell command
>> without necessarily executing it.
>> 
>> - Receive the probably non zero exit codes after process execution
>> finished.
>> 
>> - Send arbitrary POSIX signals to an asynchronously running
>> process. (This can obviously not be done on windows systems.)
>> 
>> - Terminate a currently running process. This is only feasible for 
>> asynchronously running processes where such operations can be
>> triggered while the process is running.
> 
> It would also be good to have an overview of which processes are
> running as "children" so that an interface can be presented that
> allows you to watch the status (running, alive, dead, stopped,
> terminated) and perhaps kill them.
> 
> Another possibility perhaps could be to spawn in one go multiple 
> processed as "worker threads".

I definitely like both of the ideas.Because each SystemProcess object is
supposed to represent only one running process, some kind of
SystemProcessGroup could be introduced to bundle processes and retrieve
their current state. The group could also implement static methods to
allow the creation of x worker threads using one given SystemProcess
object as some sort of template for that. A usable interface for that
would need to take care of the fact that each worker might need slightly
different arguments.

If this is what you had in mind I will update the requirements document
accordingly.

>> Design goals ============
>> 
>> The workflow of a creating a SystemProcess object applying certain
>> arguments as well as options to it and finally spawning the process
>> should be intuitive as possible. The best way to achieve such an
>> intuitive API would be to design it having the fluent interface
>> pattern in mind. The used interface should look something like
>> this::
>> 
>> new ezcSystemProcess( 'echo' )->argument( 'foo' )->execute();
> 
> Method chaining can not be done with "new classname", so it has to
> be:
> 
> $p = new ezcSystemProcess( 'echo' ); $p->argument( 'foo'
> )->execute();

Thanks for the hint I will fix this.

- --
Jakob Westhoff                                        (GPG 0xCBF7FC6A)
http://westhoffswelt.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQEcBAEBAgAGBQJJhxnxAAoJEE0XwzzL9/xqC/8IAOoFhB/7JI1HRKkJFAG9a6sC
G6AAaNQri1JQtF/TNyXgrHBqw5T3YyUSjXi5k4mI4udLqcjZGXW9kgaBYrkvW08i
lmYgf8IL/cuE7/txEgSorHdQSZw5ymWIsjdSzoIbCnT8GG1zck7e438w2jQbEKNw
DTNz+ujA1BTgV8LRKhqCWBek42ihZCuPFBEEFch5qCQUTgxHxe2n0qE+iUmO5qYA
3Q0mSU8rpSnv//tks/yqOsLsXppy+HHFCM8Hvr/rN1o9BOwKbpZwse7V0fi5gV2a
joJ67lo7Nut5osWfa+tJtPxhldaz+lGGAY1JhxpBjUqkvCnAOhDAQlLkWA1QE9w=
=GTfe
-----END PGP SIGNATURE-----
-- 
Components mailing list
Components@lists.ez.no
http://lists.ez.no/mailman/listinfo/components

Reply via email to