this is my situation:
I use org.python.util.PythonInterpreter in my web application to process
python scripts that users had uploaded in the db.
After upload, users can execute that scripts. If one of these scripts
contain an infinite loop obviously the Interpreter never exit.
This is my code:
PythonInterpreter python = mybean.createInterpreter();
pylog.write( ("### Executing script: " +
script.getName() + " ###\n") );
python.exec( script.getCode() );
There is a way to interrupt the interpreter? can I set a timeout to exit
if it expire or something like that?
Using a thread is not a solution because there isn't way to stop the
thread if it is blocked on python.exec( script.getCode() ) statement.