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 <[email protected]>

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
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos


--
Lars Tandle Kyllingstad
@: [email protected]
#: 40233221
w: http://www.kyllingen.net
_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos

Reply via email to