Author amak
Recipients amak, yocaba
Date 2016-08-22.12:54:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
JSR 223 does have facilities for dealing with these situations.

All ScriptEngine "eval" calls can take an optional ScriptContext which defines, among other things, the input and output channels. PyScriptEngine also supports this method.

However, ScriptContext is just an interface, and cannot be instantiated.

So you could write your own implementation of ScriptContext, which can provide separate input and output channels for every call to the eval method.

The good thing about this is that your implementation of ScriptContext would be completely reusable: you could use the same class for every JSR 223 language you might want to support.

You could simplify things by using SimpleScriptContext.

Hope this helps.

Date User Action Args
2016-08-22 12:54:29amaksetmessageid: <>
2016-08-22 12:54:29amaksetrecipients: + amak, yocaba
2016-08-22 12:54:29amaklinkissue2513 messages
2016-08-22 12:54:28amakcreate