Skip to content

Calling ph.exit() doesn't terminate spawned process #24

@ryanone

Description

@ryanone

Hi, has anyone else encountered this issue? I spawn one or more child processes (ie. PhantomJS instances). After opening up whatever web pages I need to open up, I naturally want to call exit(). However, this doesn't kill/terminate the child processes, and so I'm left with a bunch of orphans.

I've found what hopes to be a fix. Inside of node-phantom.js, we have a proxy variable at the bottom, which is an object with an exit() method. Right now, all it does is call request(). If we add a call to phantom.exit('SIGTERM'), that seems to do the trick.

I can send a pull request if you'd like.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions