You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by sterg <st...@teiemt.gr> on 2017/01/24 10:47:39 UTC

TimedInterrupt annotation for executing scripts with GroovyShell

Hi all,


I tried o use @TimeInterrupt annotation with GroovyLab,

in order to interrupt scripts that take much time.


I implemented a TimedInterrupt mode,
in which GroovyLab inserts the line
@TimedInterrupt( ...)
before each script
and then passes the script to the GroovyShell for evaluate().

The timed interrupt works but unfortunately the binding of variables 
fails to work properly.

I suspect that the TimedInterrupt annotation should be placed,
before the method run() of the script,
so a possible solution is to intervene at the Groovy's source code,
however that is not elegant,
since it requires compiling Groovy's source with GroovyLab.

Exists some other better solution?

Best Regards
Stergios