Skip to content
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

Check for Thread.isInterrupted() when executing compiled scripts #49

Open
ydewit opened this issue Jun 4, 2012 · 3 comments
Open

Check for Thread.isInterrupted() when executing compiled scripts #49

ydewit opened this issue Jun 4, 2012 · 3 comments
Labels
docs Issues containing stuff that ought to be documented Java Interop Issues related to the interaction between Java and JavaScript

Comments

@ydewit
Copy link

ydewit commented Jun 4, 2012

This will enable Rhino to play nice with ThreadPoolExecutor when the client calls Future.cancel(true);

@p-bakker p-bakker added Java Interop Issues related to the interaction between Java and JavaScript feature Issues considered a new feature Triage Issues yet to be triaged and removed feature Issues considered a new feature labels Jul 3, 2021
@tonygermano
Copy link
Contributor

Considering this can also be done by the javascript developer in sections with long running code, where would be the appropriate place for the engine to insert all of these checks that are not part of the script being executed? After every statement or expression evaluation?

@gbrail
Copy link
Collaborator

gbrail commented Aug 30, 2021

This is a good use case for the "observer count" functionality in the Context class, which lets you get your arbitrary code called every N bytecode instructions. It only works with compiled code (opt level >= 0), however. But it lets you do this without any changes to Rhino.

@p-bakker p-bakker added docs Issues containing stuff that ought to be documented and removed Triage Issues yet to be triaged labels Aug 31, 2021
@p-bakker
Copy link
Collaborator

Added the docs label, so once we have our new documentation in place, we can add some info to the docs about the observer count functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Issues containing stuff that ought to be documented Java Interop Issues related to the interaction between Java and JavaScript
Projects
None yet
Development

No branches or pull requests

4 participants