[Gambas-user] Starting a Process and forgetting about it

Benoît Minisini gambas at ...1...
Tue Aug 13 01:29:04 CEST 2013


Le 07/08/2013 10:08, Tobias Boege a écrit :
> Hi,
>
> in a project I need to start a server Process and watch its Kill event while
> the program is running. The server shall, however, continue to run even
> after my program exits.
>
> I'm kind of stuck here: If I create a Process, Gambas keeps watching it and
> doesn't shutdown the program until the process dies. Can I somehow tell
> Gambas to forget about that Process and just exit?
>
> I have used the Quit instruction until a minute ago (without any errors or
> complaints) to get the program down ultimately but as I know this is a Bad
> Idea: here's my mail.
>
> Now I'm working around this problem like that: I use the Shell instruction
> to start a shell as the child process Gambas watches. I can safely kill the
> shell which makes Gambas happy and reparents the server to init which is
> also fine. I have either to document this workaround because IMHO it's quite
> subtle or have an explicit way of having Gambas forget about a Process...
>
> Regards,
> Tobi
>

I added the Process.Ignore() method in revision #5791 for that. Tell me 
if it works for you.

Regards,

-- 
Benoît Minisini




More information about the User mailing list