JMaglev is finally public available!
I’m releasing my experiments with JRuby and Terracotta, so you can play with JMaglev and contribute some code. The project is in Github.
I had to patch JRuby to make RubyObjects a little less dependent from the JRuby Runtime. It isn’t perfect yet, but is working. The patch against the current jruby trunk (rev. 8091) and the patched jruby-complete are included in the project.
The code in Github is just a TIM (Terracotta Integration Module) with a sample maven project and the JMaglev use-case included. Unfortunately, I haven’t any time yet to upload the TIM to Terracotta Forge. BTW, does anyone know how to do this?
For those who want to reproduce my JMaglev demo, here is a step-by-step. You must have GIT, Maven 2 and the JDK properly installed. It only works on Linux and OS X. Is anyone wanting to contribute support for Windows users?
git clone git://github.com/fabiokung/clustered-jruby.git
- long time waiting, because terracotta-2.7.1 (vanilla) and jruby-complete (patched) are bundled.
cd clustered-jruby
mvn install
(althoughmvn package
is enough)cd jmaglev
- start the terracotta server:
lib/terracotta-2.7.1/bin/start-tc-server.sh
- open another two terminals
- run the simplified jirb inside them:
- Follow the demo. You will be able to share global variables among all jmaglevs:
require 'hat' $hat require 'rabbit' $hat.put(Rabbit.new)
- in the other terminal, try to see the magic hat contents:
$hat
cd clustered-jruby/jmaglev ./bin/jmaglev jmaglev.rb
I haven’t tested it with rails applications, but right now, it isn’t able to run IRB. I never thought that running IRB could be so hard. 🙂
More drawbacks and limitations are being discussed in the JRuby Users Mailing List.
I hope to see many contributions. Happy hacking!