Reputation: 1840
I have a groovy script file, that I run with GroovyShell. How to stop executing of script? I tried put it in new thread and later interrupt thread but it does not work.
Upvotes: 2
Views: 5514
Reputation: 171054
There is another question here from last year asking a similar thing:
Stopping the execution of a Groovy script
There is also a ThreadInterrupt AST transform which may help. Also, see the TimedInterrupt transform
Upvotes: 1