-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserving PhantomJS instance across code-reloads in development #1
Comments
Thanks for the kind words! I am not sure I understand how to reproduce this issue. I've copied the posted code into a new meteor 'Hello' app but the orphaned process is detected fine for me. You can see in the following log starting the app and then making a change to the code:
What OS are you running? If you could post a repo that I could clone to see the error that would be helpful. As for the auto-port selector, I am considering replacing my linux foo with an NPM package like this: https://www.npmjs.org/package/get-port From your question though, I wonder if you want the PhantomJS process to continue running after a new code push? In order to implement this, it would probably be possible to continue issuing requests to an orphaned PhantomJS process but it may be difficult to detect if that process was successfully processing the requests. Right now, when the code push occurs, your Meteor server (a node.js instance) starts a new process. Because PhantomJS is a child process, it becomes orphaned. This code will kill an orphaned PhantomJS if it occupies the port requested because it assumes that it was originally spawned by the app as well. -Ben |
* Intended to fix Mac OSX compatibility See: #1 * Also added port property and kill() method to the executive function
Ok, I've updated the package with the NPM get-port package. Give 0.0.9 a try! There are a few changes to the interface:
Please let me know if this fixes your issues. |
Hi there,
Thanks for your work on this great smart package.
In my server code I'm running
phantomLaunch
to start a new instance of PhantomJS and assigning it to a global variable.However, upon server reload after a code change, I see this error in the server console:
At this time, if I navigate to
localhost:13470
, I still get output, so PhantomJS is still running. It looks like some vital state information is being lost from reload to reload.If I just reassign
PhantomInstance
, the port number increments with each server reload as the old instances of PhantomJS continue to run under Meteor.Do you know of any acceptable workarounds?
Kind regards,
Chris
The text was updated successfully, but these errors were encountered: