AndroidJSCore icon indicating copy to clipboard operation
AndroidJSCore copied to clipboard

Is there a way to stop eval script?

Open huziu235 opened this issue 10 years ago • 3 comments

I want to stop a running script and eval a new one, is there a way?

huziu235 avatar Mar 23 '16 02:03 huziu235

I do not expose any methods to do that, no. The only way I can think to do it is to kill the running pthread. Any reason why you want to stop a running script? JS isn't really designed to handle long running processes. If your script is getting stuck due to the 2.1 bug that is causing deadlocking, I suggest two things: (1) send me your failing JS and let me debug the problem -- I do not yet have a test case I can use to debug 2.1, and (2) revert to version 2.0 until a patch has been deployed.

ericwlange avatar Apr 20 '16 03:04 ericwlange

I have created a 2.2 pre-release which should help with the stability issues. Please re-open if this doesn't help.

ericwlange avatar May 01 '16 03:05 ericwlange

Hi Eric,

Thank you for AndroidJSCore! I'm using it for an Android application that uses Blockly to control a bluetooth connected robot (see github.com/tharvey/BlocklyBot and https://robotstem.wordpress.com/).

In my use case the javascript may loop forever waiting for external event handlers which I hook into the code, so I very much find use in stopping the script. Is this something you can add or point me to where I might do it? If killing the thread is the way to go can you give me some pointers? I'm still coming up to speed on Android app development.

Regards,

Tim

tharvey avatar Sep 08 '16 06:09 tharvey