Charles Oliver Nutter wrote:
Nailgun is a project that appears to be mostly dead since 2005, but it
basically provides a simple "JVM server" on one end and a native client
on the other. You call ng like you'd call java, with a class and
arguments it should be passed. And it sends that class and arguments
across a socket to the ng server, where the class is started up and the
streams are all piped back and forth. When the class terminates, the
client terminates.
I've got Nailgun working with JRuby just great now.
bin/jruby-ng-server
bin/jruby-ng
If you want to use the server, say if you're going to be running a lot
of command-line tools, just spin it up in the background somewhere.
jruby-ng-server > /dev/null 2> /dev/null &
And then use the jruby-ng command instead, or alias it to "jruby"
alias jruby=jruby-ng
You'll need to make the ng client command on your platform, by running
'make' under bin/nailgun, but then everything should function correctly.
jruby-ng -e "puts 'here'"
The idea is that users will have a new option to try. For JRuby, where
we have no global variables, no dependencies on static fields, and
already depend on our ability to spin up many JRuby instances in a
single JVM, this ends up working very well. It's building off features
we already provide, and giving users the benefit of a fast,
pre-initialized JVM without the startup hit.
I think we're probably going to ship with this for JRuby 1.1 now. It's
working really well. I've managed to resolve the CWD issue by defining
my own "nailMain" next to our existing "main", and ENV vars are being
passed along as well. The one big remaining complication I don't have an
answer for just yet is OS signals; they get registered only in the
server process, so signals from the client don't propagate through. It's
fixable of course, by having the client register and the server just
listen for client signal events, but that isn't supported in the current
NG. So there's some work to do.
All the NG stuff is in JRuby trunk right now. Give it a shot. I'm
interested in hearing opinions on it.
- Charlie
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email