Skip to content

Add ability to trigger render from page code #264

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

Closed

Conversation

chriskinsman
Copy link
Collaborator

This was surprisingly difficult to get everything working.

onCallback and onLoadFinished need to be interlocked so that page.render() is not called before the onLoadFinished callback fires. If this happens nothing will be rendered.

If onCallback arrives before onLoadFinished a flag is set to indicate that when onLoadFinished is called it should immediately render instead of waiting the renderDelay.

If onLoadFinished arrives before onCallback a flag is set to indicate that onLoadFinished has completed and the renderDelay is started. When onCallback arrives and sees that onLoadFinished has already arrived it cancels the renderDelay and renders the page.

Test is included that checks to see if the page is rendered in < 10s vs the renderDelay timeout of 120s.

Any further testing would require reading of the PDF...

@rowan-met
Copy link

@chriskinsman Do you know whether this functionality is going to be merged?

@chriskinsman
Copy link
Collaborator Author

Would love it to be but it needs an approved review it says.

Looks like there have not been any merges since February so not sure if the current maintainer is working on it any longer...

@marcbachmann
Copy link
Owner

marcbachmann commented Sep 27, 2017

Released in v2.2.0
Sorry for the delay. There were a few things to clean up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants