I want to embed JRuby in Java in order to execute ruby code that is
provided by the user (can be cached/compiled), unique scripts don’t
to be in the 10s.
The JSR / BSF options are problematic, due to the performance
of them (basically, the lifecycle they provide is not amazing). What I
doing is allowing to provide a script that will run hunders of thousands
hits as part of a single search request (sharded and all, but still).
In the other two langs that I have already integrated, using the low
level API made a big difference. Reusing the same Script instance in
groovy for a single search request (a request search is single threaded)
a huge win. In groovy, I can set the “parameters” for the script on the
script object itself (they mostly don’t change between invocation on
hit), and in rhino I can set them on a scope that I create per search
request and reuse per hit. (I don’t want to rub anything in here, just
trying to explain better what I after though it).
I was wondering if its possible in jruby, I can’t seem to work out
do something similar. The point that I am at now is that I will need to
create ScriptingContainers myself, maintain a pool of them, compile and
cache scripts per container, just so I can provide though custom
per search request. This really complicates things on my end, since I
to introduce additional custom lifecycle events to my custom scripting
which are hard to execute (one to obtain a scripting container from a
and one to return it). Is that really what I need to do? Or is there an
option to set parameters on an “instance” of a compiled script (The
itself in groovy, a scope in rhino)?
View this message in context:
Sent from the JRuby - User mailing list archive at Nabble.com.
To unsubscribe from this list, please visit: