the priority of the idle source; typically this will be in the range between GLib.PRIORITY_DEFAULT_IDLE and GLib.PRIORITY_HIGH_IDLE
process to watch — on POSIX systems, this is the positive PID of a child process; on Windows it is a handle for a process (which doesn’t have to be a child)
function to call
Optionalnotify: DestroyNotifyfunction to call when the idle is removed
the ID (greater than 0) of the event source
Sets a function to be called when the child indicated by
pidexits, at the prioritypriority.If you obtain
pidfrom GLib.spawn_async or GLib.spawn_async_with_pipes you will need to pass GLib.SpawnFlags.DO_NOT_REAP_CHILD as a flag to the spawn function for the child watching to work.In many programs, you will want to call GLib.spawn_check_wait_status in the callback to determine whether or not the child exited successfully.
Also, note that on platforms where GLib.Pid must be explicitly closed (see GLib.spawn_close_pid)
pidmust not be closed while the source is still active. Typically, you should invoke GLib.spawn_close_pid in the callback function for the source.GLib supports only a single callback per process ID. On POSIX platforms, the same restrictions mentioned for GLib.child_watch_source_new apply to this function.
This internally creates a main loop source using GLib.child_watch_source_new and attaches it to the main loop context using GLib.Source.attach. You can do these steps manually if you need greater control.