Closed
Description
Current, Process
invokes wait
in its destructor to prevent leaking the child process for a long-running parent (see #13854 for discussion and more info). This does not support the use case of a child outliving the parent (such as creating a daemon).
A new method should be added to the Process
type, perhaps detach
, which consumes the Process
and cancels the call to wait
in the destructor. Something along the lines of:
// Forgets this process, allowing it to outlive the parent
//
// This function will forcefully prevent calling `wait()` on the child
// process in the destructor, allowing the child to outlive the
// parent. Note that this operation can easily lead to leaking the
// resources of the child process, so care must be taken when
// invoking this method.
pub fn detach(self) { /* ... */ }
Metadata
Metadata
Assignees
Labels
No labels