groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sterg <>
Subject TimedInterrupt annotation for executing scripts with GroovyShell
Date Tue, 24 Jan 2017 10:47:39 GMT
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

View raw message