Jubilee
¶ ↑
“We need a web framework for
Vertx
.”, you said.“But why not use
Vertx
in your Rails applications, it's the most productive web framework ever created.”
The Answer is Jubilee
, a rack server with vertx 2.0 awesomeness builtin.
Why another rack server?¶ ↑
“Vert.x is a lightweight, high performance application platform for the JVM that's designed for modern mobile, web, and enterprise applications.” - vertx.io site
In short, Vertx
is nodejs on the JVM, only much more faster, checkout the awesome benchmarks
By using Vertx
, jubilee inherent advantages in terms of performance, and all the other cool features of Vertx:
Installation¶ ↑
$ jruby -S gem install jubilee
Jubilee
requires JRuby 1.7.0 or later, and JDK 7+
Get started¶ ↑
$ cd a-rack-app $ jruby -S jubilee
Setup¶ ↑
If you use bundler, you might want to add jubilee
to your Gemfile
$ jubilee
or if you prefer to use the rack handler(e.g. development) use:
$ rails s jubilee
or
$ rackup -s jubilee
Event Bus¶ ↑
Event Bus is a pub/sub mechanism, it can be used from server to server, server to client and client to client, with the same API!
Examples¶ ↑
Assume necessary javascript files are loaded in the page (they can be found here), start jubilee in a rack application with:
$ jubilee --eventbus /eventbus
In one browser:
var eb = new vertx.EventBus("/eventbus"); eb.registerHandler("test", function(data){ console.info(data); });
In another:
var eb = new vertx.EventBus("/eventbus"); eb.send("test", "hello, world");
For more advanced examples, checkout the chatapp.
License¶ ↑
The same as JRuby and vertx