fork


Description:

[ Version ( experimental = true , since = "0.3" ) ]
public virtual Pid fork () throws Error

Fork the execution.

This is typically called after VSGI.Server.listen such that workers can share listening interfaces and descriptors.

The default implementation wraps Posix.fork and check its return value. To disable forking, simply override this and return '0'.

Marked as experimental because we might change this for a more sophisticated model based in GLib.Subprocess in the future.

Returns:

the process pid if this is the parent process, otherwise '0'

Exceptions:

GLib.SpawnError.FORK

if the Posix.fork call fails