Skip to content

Use Job Objects and equivalent things on Mac/Linux #10

@egonelbre

Description

@egonelbre

Currently when starting things with watchrun go run main.go and main.go contains a server, then watchrun doesn't automatically kill the subprocess. Which is not ideal. We can overcome this limitation by monitoring which subprocesses are created and then ensure they are killed as a whole.

On Windows there are Job Objects, which allow such process groups that can be killed as a whole. The current approach for killing processes in Windows is rather hacky https://github.com/loov/watchrun/blob/master/pgroup/kill_windows.go#L19.

I'm not sure what the best approach on Unix is, but may be monitoring things with ptrace and capturing the pids?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions