[phobos] Suggestions for std.process

Lars Tandle Kyllingstad lars at kyllingen.net
Mon Mar 8 04:22:09 PST 2010


It doesn't necessarily require hiding anything from the user, it could 
be made very explicit both in the documentation and in the function 
signature.

   Tid spawnProcessWaitingThread
     (string name, void function() onComplete);

However, it can be argued that it probably won't save much typing, since 
the new thread-spawning function has such a terse syntax:

   spawnProcessWaitingThread
     ("firefox", { ... // when Firefox exits, do this });

vs.

   spawn({
     spawnProcess("firefox").wait();
     ... // when Firefox exits, do this
   });

-Lars



Steve Schveighoffer wrote:
> I think what Sean is trying to say is he wants that feature on windows if it is supported.  It seemed like he was implying that it was available on Linux and if windows supported it, it should be available as an abstract function.
> 
> I think you can do this on windows with a asynchronous event, but I'm not sure.  But I think you'd have to do the thread method for POSIX OSes.  I don't think this is an important feature to add, a hidden thread spawn in a method is not a good idea.
> 
> -Steve
> 
> 
> 
> ----- Original Message ----
>> From: Lars Tandle Kyllingstad <lars at kyllingen.net>
>>
>> I don't know any way of doing this besides spawning a separate thread 
>> that a) starts the process, b) waits for it to complete, and c) calls 
>> the callback function/delegate.
>>
>> Is this what you had in mind?
>>
>> -Lars
>>
>>
>> Sean Kelly wrote:
>>> I'm not sure if this is supported in Windows, but if so, it might be nice if I 
>> could set a callback that would be executed when the process completes.
> 
> 
>       
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos


-- 
Lars Tandle Kyllingstad
@: lars at kyllingen.net
#: 40233221
w: http://www.kyllingen.net


More information about the phobos mailing list