In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment...
Transcript of In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment...
![Page 1: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/1.jpg)
Ola BiniJRuby Core DeveloperThoughtWorks Studios
[email protected]://olabini.com/blog
In action!JRuby
![Page 2: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/2.jpg)
Agendawhat
why
how
rails
other things
real world
the future
q & a
![Page 3: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/3.jpg)
what
![Page 4: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/4.jpg)
What is JRuby
![Page 5: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/5.jpg)
What is JRubyImplementation of the Ruby language
![Page 6: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/6.jpg)
What is JRubyImplementation of the Ruby language
Java 1.5+
![Page 7: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/7.jpg)
What is JRubyImplementation of the Ruby language
Java 1.5+
Open Source
![Page 8: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/8.jpg)
What is JRubyImplementation of the Ruby language
Java 1.5+
Open Source
Compatible with Ruby 1.8.6 p114
![Page 9: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/9.jpg)
What is JRubyImplementation of the Ruby language
Java 1.5+
Open Source
Compatible with Ruby 1.8.6 p114
Current versions 1.1.4 and 1.0.3
![Page 10: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/10.jpg)
Community
![Page 11: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/11.jpg)
Community7.5 core developers
![Page 12: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/12.jpg)
Community7.5 core developers
40-50 contributors
![Page 13: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/13.jpg)
Community7.5 core developers
40-50 contributors
New projects from JRuby:
![Page 14: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/14.jpg)
Community7.5 core developers
40-50 contributors
New projects from JRuby:
JOni
![Page 15: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/15.jpg)
Community7.5 core developers
40-50 contributors
New projects from JRuby:
JOni
RbYAML, JvYAML, JvYAMLb
![Page 16: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/16.jpg)
Community7.5 core developers
40-50 contributors
New projects from JRuby:
JOni
RbYAML, JvYAML, JvYAMLb
JNA-Posix
![Page 17: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/17.jpg)
Community7.5 core developers
40-50 contributors
New projects from JRuby:
JOni
RbYAML, JvYAML, JvYAMLb
JNA-Posix
JOpenSSL
![Page 18: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/18.jpg)
Compatibility
![Page 19: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/19.jpg)
CompatibilityUsing the RubySpecs
![Page 20: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/20.jpg)
CompatibilityUsing the RubySpecs
Applications are king
![Page 21: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/21.jpg)
CompatibilityUsing the RubySpecs
Applications are king
Rails, RubyGems, Rake, RSpec
![Page 22: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/22.jpg)
CompatibilityUsing the RubySpecs
Applications are king
Rails, RubyGems, Rake, RSpec
Testing is cool
![Page 23: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/23.jpg)
CompatibilityUsing the RubySpecs
Applications are king
Rails, RubyGems, Rake, RSpec
Testing is cool
~ 42,000 expectations/assertions
![Page 24: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/24.jpg)
CompatibilityUsing the RubySpecs
Applications are king
Rails, RubyGems, Rake, RSpec
Testing is cool
~ 42,000 expectations/assertions
Prevents regressions
![Page 25: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/25.jpg)
CompatibilityUsing the RubySpecs
Applications are king
Rails, RubyGems, Rake, RSpec
Testing is cool
~ 42,000 expectations/assertions
Prevents regressions
Better definition of Ruby
![Page 26: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/26.jpg)
CompatibilityUsing the RubySpecs
Applications are king
Rails, RubyGems, Rake, RSpec
Testing is cool
~ 42,000 expectations/assertions
Prevents regressions
Better definition of Ruby
Might also prevent community fragmentation
![Page 27: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/27.jpg)
CompatibilityUsing the RubySpecs
Applications are king
Rails, RubyGems, Rake, RSpec
Testing is cool
~ 42,000 expectations/assertions
Prevents regressions
Better definition of Ruby
Might also prevent community fragmentation
Like Sapphire
![Page 28: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/28.jpg)
CompatibilityUsing the RubySpecs
Applications are king
Rails, RubyGems, Rake, RSpec
Testing is cool
~ 42,000 expectations/assertions
Prevents regressions
Better definition of Ruby
Might also prevent community fragmentation
Like Sapphire
![Page 29: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/29.jpg)
Why? why
![Page 30: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/30.jpg)
Why JRuby?
![Page 31: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/31.jpg)
Why JRuby?Threading
![Page 32: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/32.jpg)
Why JRuby?Threading
Unicode
![Page 33: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/33.jpg)
Why JRuby?Threading
Unicode
Performance
![Page 34: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/34.jpg)
Why JRuby?Threading
Unicode
Performance
Memory
![Page 35: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/35.jpg)
Why JRuby?Threading
Unicode
Performance
Memory
C Extensions
![Page 36: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/36.jpg)
Why JRuby?Threading
Unicode
Performance
Memory
C Extensions
Libraries
![Page 37: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/37.jpg)
Why JRuby?Threading
Unicode
Performance
Memory
C Extensions
Libraries
Politics
![Page 38: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/38.jpg)
Why JRuby?Threading
Unicode
Performance
Memory
C Extensions
Libraries
Politics
Legacy systems
![Page 39: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/39.jpg)
Why JRuby on Rails?
![Page 40: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/40.jpg)
Why JRuby on Rails?Same same
![Page 41: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/41.jpg)
Why JRuby on Rails?Same same
Conservative organizations (IS)
![Page 42: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/42.jpg)
Why JRuby on Rails?Same same
Conservative organizations (IS)
Deployment
![Page 43: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/43.jpg)
Why JRuby on Rails?Same same
Conservative organizations (IS)
Deployment
Integration
![Page 44: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/44.jpg)
Why JRuby on Rails?Same same
Conservative organizations (IS)
Deployment
Integration
Monitoring
![Page 45: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/45.jpg)
Why JRuby on Rails?Same same
Conservative organizations (IS)
Deployment
Integration
Monitoring
Ruby + Java == Cost efficiency && plausible fallback
![Page 46: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/46.jpg)
How?how
![Page 47: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/47.jpg)
Getting started
![Page 48: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/48.jpg)
Getting startedInstall Java
![Page 49: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/49.jpg)
Getting startedInstall Java
Download http://dist.codehaus.org/jruby/jruby-bin-1.1.4.tar.gz
![Page 50: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/50.jpg)
Getting startedInstall Java
Download http://dist.codehaus.org/jruby/jruby-bin-1.1.4.tar.gz
This includes JRuby, Ruby stdlib, RubyGems and rake
![Page 51: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/51.jpg)
Getting startedInstall Java
Download http://dist.codehaus.org/jruby/jruby-bin-1.1.4.tar.gz
This includes JRuby, Ruby stdlib, RubyGems and rake
Unpack
![Page 52: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/52.jpg)
Getting startedInstall Java
Download http://dist.codehaus.org/jruby/jruby-bin-1.1.4.tar.gz
This includes JRuby, Ruby stdlib, RubyGems and rake
Unpack
Multiple copies are fine
![Page 53: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/53.jpg)
Getting startedInstall Java
Download http://dist.codehaus.org/jruby/jruby-bin-1.1.4.tar.gz
This includes JRuby, Ruby stdlib, RubyGems and rake
Unpack
Multiple copies are fine
Add <jruby-dir>/bin to PATH
![Page 54: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/54.jpg)
Getting startedInstall Java
Download http://dist.codehaus.org/jruby/jruby-bin-1.1.4.tar.gz
This includes JRuby, Ruby stdlib, RubyGems and rake
Unpack
Multiple copies are fine
Add <jruby-dir>/bin to PATH
Install gems
![Page 55: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/55.jpg)
Getting startedInstall Java
Download http://dist.codehaus.org/jruby/jruby-bin-1.1.4.tar.gz
This includes JRuby, Ruby stdlib, RubyGems and rake
Unpack
Multiple copies are fine
Add <jruby-dir>/bin to PATH
Install gems
gem install rspec
![Page 56: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/56.jpg)
Getting startedInstall Java
Download http://dist.codehaus.org/jruby/jruby-bin-1.1.4.tar.gz
This includes JRuby, Ruby stdlib, RubyGems and rake
Unpack
Multiple copies are fine
Add <jruby-dir>/bin to PATH
Install gems
gem install rspec
jruby -S gem install rspec
![Page 57: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/57.jpg)
Calling Ruby from Java
// One-time load Ruby runtimeScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine engine = factory.getEngineByName("jruby");
// Evaluate JRuby code from string.try { engine.eval("puts('Hello')");} catch (ScriptException exception) { exception.printStackTrace();}
![Page 58: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/58.jpg)
Java Integration
![Page 59: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/59.jpg)
Java IntegrationJava types == Ruby types
![Page 60: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/60.jpg)
Java IntegrationJava types == Ruby types
Call methods, construct instances, pass objects around
![Page 61: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/61.jpg)
Java IntegrationJava types == Ruby types
Call methods, construct instances, pass objects around
camelCase or snake_case both valid
![Page 62: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/62.jpg)
Java IntegrationJava types == Ruby types
Call methods, construct instances, pass objects around
camelCase or snake_case both valid
Interfaces can be implemented
![Page 63: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/63.jpg)
Java IntegrationJava types == Ruby types
Call methods, construct instances, pass objects around
camelCase or snake_case both valid
Interfaces can be implemented
Classes can be inherited from
![Page 64: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/64.jpg)
Java IntegrationJava types == Ruby types
Call methods, construct instances, pass objects around
camelCase or snake_case both valid
Interfaces can be implemented
Classes can be inherited from
Implicit closure conversion
![Page 65: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/65.jpg)
Java IntegrationJava types == Ruby types
Call methods, construct instances, pass objects around
camelCase or snake_case both valid
Interfaces can be implemented
Classes can be inherited from
Implicit closure conversion
Extra added features to Rubyfy Java classes and Interfaces
![Page 66: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/66.jpg)
DemoJava Integration
![Page 67: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/67.jpg)
Differences to MRI
![Page 68: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/68.jpg)
Differences to MRINo continuations
![Page 69: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/69.jpg)
Differences to MRINo continuations
will you miss them?
![Page 70: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/70.jpg)
Differences to MRINo continuations
will you miss them?
No native extensions
![Page 71: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/71.jpg)
Differences to MRINo continuations
will you miss them?
No native extensions
you might miss them
![Page 72: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/72.jpg)
Differences to MRINo continuations
will you miss them?
No native extensions
you might miss them
No crappy GC
![Page 73: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/73.jpg)
Differences to MRINo continuations
will you miss them?
No native extensions
you might miss them
No crappy GC
you won’t miss that
![Page 74: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/74.jpg)
Differences to MRINo continuations
will you miss them?
No native extensions
you might miss them
No crappy GC
you won’t miss that
File and POSIX operations is still not 100%
![Page 75: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/75.jpg)
Rails?
rails
![Page 76: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/76.jpg)
Getting started
[jaoo] (1) ʎ jruby -S gem install rails
[jaoo] (2) ʎ jruby -S gem install activerecord-jdbcmysql-adapter
[jaoo] (3) ʎ jruby -S rails yourapp -d mysql
[jaoo] (4) ʎ cd yourapp
[jaoo] (5) ʎ sed -i -e 's/mysql/jdbcmysql/g' config/database.yml
[jaoo] (6) ʎ jruby script/server
![Page 77: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/77.jpg)
GlassFish
![Page 78: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/78.jpg)
GlassFishModular application server
![Page 79: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/79.jpg)
GlassFishModular application server
Full support for JEE 5
![Page 80: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/80.jpg)
GlassFishModular application server
Full support for JEE 5
Monitoring etc
![Page 81: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/81.jpg)
GlassFishModular application server
Full support for JEE 5
Monitoring etc
Support for several alt JVM languages
![Page 82: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/82.jpg)
GlassFishModular application server
Full support for JEE 5
Monitoring etc
Support for several alt JVM languages
Ruby, PHP, JavaScript
![Page 83: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/83.jpg)
GlassFishModular application server
Full support for JEE 5
Monitoring etc
Support for several alt JVM languages
Ruby, PHP, JavaScript
[jaoo] (7) ʎ jruby -S gem install glassfish
![Page 84: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/84.jpg)
GlassFishModular application server
Full support for JEE 5
Monitoring etc
Support for several alt JVM languages
Ruby, PHP, JavaScript
[jaoo] (7) ʎ jruby -S gem install glassfish
![Page 85: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/85.jpg)
GlassFishModular application server
Full support for JEE 5
Monitoring etc
Support for several alt JVM languages
Ruby, PHP, JavaScript
[jaoo] (7) ʎ jruby -S gem install glassfish
Size of glassfish-0.2.0-universal-java.gem: 2870784 bytes
![Page 86: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/86.jpg)
DemoGlassFish gem
![Page 87: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/87.jpg)
Jetty-Rails
![Page 88: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/88.jpg)
Jetty-RailsNew project by Fabio Kung
![Page 89: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/89.jpg)
Jetty-RailsNew project by Fabio Kung
Works with Warbler configuration
![Page 90: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/90.jpg)
Jetty-RailsNew project by Fabio Kung
Works with Warbler configuration
Similar to the GlassFish gem, but more light weight
![Page 91: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/91.jpg)
Jetty-RailsNew project by Fabio Kung
Works with Warbler configuration
Similar to the GlassFish gem, but more light weight
For development phase of Warbler enabled project
![Page 92: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/92.jpg)
JNDI
![Page 93: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/93.jpg)
JNDIIn production
![Page 94: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/94.jpg)
JNDIIn production
Fall back on regular database configuration
![Page 95: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/95.jpg)
JNDIIn production
Fall back on regular database configuration
Add:
![Page 96: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/96.jpg)
JNDIIn production
Fall back on regular database configuration
Add:jndi: jdbc/yourapp_production
To your database.yml
![Page 97: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/97.jpg)
JNDIIn production
Fall back on regular database configuration
Add:jndi: jdbc/yourapp_production
To your database.yml
Get:
![Page 98: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/98.jpg)
JNDIIn production
Fall back on regular database configuration
Add:jndi: jdbc/yourapp_production
To your database.yml
Get:
Manageability
![Page 99: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/99.jpg)
JNDIIn production
Fall back on regular database configuration
Add:jndi: jdbc/yourapp_production
To your database.yml
Get:
Manageability
Securability
![Page 100: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/100.jpg)
JNDIIn production
Fall back on regular database configuration
Add:jndi: jdbc/yourapp_production
To your database.yml
Get:
Manageability
Securability
Poolability
![Page 101: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/101.jpg)
JNDIIn production
Fall back on regular database configuration
Add:jndi: jdbc/yourapp_production
To your database.yml
Get:
Manageability
Securability
Poolability
![Page 102: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/102.jpg)
Deployment
![Page 103: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/103.jpg)
DeploymentTraditional approach
![Page 104: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/104.jpg)
DeploymentTraditional approach
Pack of Mongrels
![Page 105: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/105.jpg)
DeploymentTraditional approach
Pack of Mongrels
N mongrels for N concurrent requests
![Page 106: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/106.jpg)
DeploymentTraditional approach
Pack of Mongrels
N mongrels for N concurrent requests
Deployed with Capistrano
![Page 107: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/107.jpg)
DeploymentTraditional approach
Pack of Mongrels
N mongrels for N concurrent requests
Deployed with Capistrano
Something in front, like Nginx or Apache HTTPd
![Page 108: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/108.jpg)
DeploymentTraditional approach
Pack of Mongrels
N mongrels for N concurrent requests
Deployed with Capistrano
Something in front, like Nginx or Apache HTTPd
Needs monitoring
![Page 109: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/109.jpg)
DeploymentTraditional approach
Pack of Mongrels
N mongrels for N concurrent requests
Deployed with Capistrano
Something in front, like Nginx or Apache HTTPd
Needs monitoring
Monit
![Page 110: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/110.jpg)
DeploymentTraditional approach
Pack of Mongrels
N mongrels for N concurrent requests
Deployed with Capistrano
Something in front, like Nginx or Apache HTTPd
Needs monitoring
Monit
God
![Page 111: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/111.jpg)
DeploymentTraditional approach
Pack of Mongrels
N mongrels for N concurrent requests
Deployed with Capistrano
Something in front, like Nginx or Apache HTTPd
Needs monitoring
Monit
God
Repeat for each application
![Page 112: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/112.jpg)
Deployment: Mongrel
![Page 113: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/113.jpg)
Deployment: MongrelSame approach “works”
![Page 114: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/114.jpg)
Deployment: MongrelSame approach “works”
For some definition of works
![Page 115: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/115.jpg)
Deployment: MongrelSame approach “works”
For some definition of works
Do you want N JVMs?
![Page 116: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/116.jpg)
Deployment: Warbler
![Page 117: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/117.jpg)
Deployment: WarblerInstalls as a gem
![Page 118: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/118.jpg)
Deployment: WarblerInstalls as a gem
JRuby included
![Page 119: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/119.jpg)
Deployment: WarblerInstalls as a gem
JRuby included
And so is a Rails servlet
![Page 120: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/120.jpg)
Deployment: WarblerInstalls as a gem
JRuby included
And so is a Rails servlet
Automates the War configuration
![Page 121: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/121.jpg)
Deployment: WarblerInstalls as a gem
JRuby included
And so is a Rails servlet
Automates the War configuration
[jaoo] (8) ʎ jruby -S gem install warbler
[jaoo] (9) ʎ jruby -S warble pluginize
![Page 122: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/122.jpg)
Deployment: WarblerInstalls as a gem
JRuby included
And so is a Rails servlet
Automates the War configuration
[jaoo] (8) ʎ jruby -S gem install warbler
[jaoo] (9) ʎ jruby -S warble pluginize
[jaoo] (10) ʎ jruby -S rake war
![Page 123: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/123.jpg)
Deployment: WarblerInstalls as a gem
JRuby included
And so is a Rails servlet
Automates the War configuration
[jaoo] (8) ʎ jruby -S gem install warbler
[jaoo] (9) ʎ jruby -S warble pluginize
[jaoo] (10) ʎ jruby -S rake war
![Page 124: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/124.jpg)
Other things
smörgåsbord
![Page 125: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/125.jpg)
Ribs
![Page 126: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/126.jpg)
RibsNot finished yet
![Page 127: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/127.jpg)
RibsNot finished yet
Uses real Hibernate under the covers
![Page 128: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/128.jpg)
RibsNot finished yet
Uses real Hibernate under the covers
AR like interface (not compatible, just inspired by AR)
![Page 129: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/129.jpg)
RibsNot finished yet
Uses real Hibernate under the covers
AR like interface (not compatible, just inspired by AR)
Can use existing Hibernate mappings and Java domains
![Page 130: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/130.jpg)
RibsNot finished yet
Uses real Hibernate under the covers
AR like interface (not compatible, just inspired by AR)
Can use existing Hibernate mappings and Java domains
Alternative to ActiveRecord
![Page 131: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/131.jpg)
RibsNot finished yet
Uses real Hibernate under the covers
AR like interface (not compatible, just inspired by AR)
Can use existing Hibernate mappings and Java domains
Alternative to ActiveRecord
Version 0.0.2 out now
![Page 132: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/132.jpg)
RibsNot finished yet
Uses real Hibernate under the covers
AR like interface (not compatible, just inspired by AR)
Can use existing Hibernate mappings and Java domains
Alternative to ActiveRecord
Version 0.0.2 out now
RepositoryUnit of WorkIdentity MapActive RecordData Mapper
![Page 133: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/133.jpg)
# define a model (not needed at all when following conventions)class Project Ribs! :table => "PROJECTS" do |r| r.id :primary_key, :column => :PROJECT_ID endend
# createproject = R(Project).create(:name => "JRuby", :complexity => 10)project_id = project.id
# queryall_projects = R(Project).alljruby_project = R(Project).get(project_id)
# updatejruby_project.complexity = 37R(jruby_project).save
# destroyR(jruby_project).destroy!
![Page 134: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/134.jpg)
Merb
![Page 135: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/135.jpg)
MerbJRuby runs Merb
![Page 136: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/136.jpg)
MerbJRuby runs Merb
JRuby-rack is the preferred solution
![Page 137: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/137.jpg)
MerbJRuby runs Merb
JRuby-rack is the preferred solution
Should Just Work (TM)
![Page 138: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/138.jpg)
JDBC
![Page 139: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/139.jpg)
JDBCCan be used directly from JRuby
![Page 140: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/140.jpg)
JDBCCan be used directly from JRuby
There is a DBI driver
![Page 141: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/141.jpg)
JDBCCan be used directly from JRuby
There is a DBI driver
DataMapper driver on the way
![Page 142: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/142.jpg)
JDBCCan be used directly from JRuby
There is a DBI driver
DataMapper driver on the way
And of course, AR-JDBC
![Page 143: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/143.jpg)
JDBCCan be used directly from JRuby
There is a DBI driver
DataMapper driver on the way
And of course, AR-JDBC
JNDI
![Page 144: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/144.jpg)
JDBCCan be used directly from JRuby
There is a DBI driver
DataMapper driver on the way
And of course, AR-JDBC
JNDI
Connection pools
![Page 145: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/145.jpg)
JDBCCan be used directly from JRuby
There is a DBI driver
DataMapper driver on the way
And of course, AR-JDBC
JNDI
Connection pools
Prepared statements
![Page 146: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/146.jpg)
Ever installed RMagick?
![Page 147: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/147.jpg)
Java2D
![Page 148: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/148.jpg)
Java2DJava2D is available everywhere. And works the same.
![Page 149: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/149.jpg)
Java2DJava2D is available everywhere. And works the same.
ImageVoodoo
![Page 150: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/150.jpg)
Java2DJava2D is available everywhere. And works the same.
ImageVoodoo
Compatible with ImageScience
![Page 151: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/151.jpg)
Java2DJava2D is available everywhere. And works the same.
ImageVoodoo
Compatible with ImageScience
Works with attachment_fu and others
![Page 152: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/152.jpg)
JRuby internalsJRuby::ast_for("1+1") #=> Java AST
JRuby::ast_for { 1+1 } #=> Java AST
JRuby::compile("1+1") #=> CompiledScript
CompiledScript.inspect_bytecode
JRuby::runtime
JRuby::reference("str")
![Page 153: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/153.jpg)
... evil stuff
a = "foobar"a.freezeJRuby::reference(a).set_frozen(false)
class Foobar; endsomething = Object.newJRuby::reference(something).set_meta_class(Foobar)
class Foobar; endJRuby::reference(Foobar).get_methods
![Page 154: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/154.jpg)
JtestR
![Page 155: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/155.jpg)
JtestRTest Java code with Ruby
![Page 156: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/156.jpg)
JtestRTest Java code with Ruby
Includes
![Page 157: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/157.jpg)
JtestRTest Java code with Ruby
Includes
RSpec (and story support)
![Page 158: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/158.jpg)
JtestRTest Java code with Ruby
Includes
RSpec (and story support)
Test::Unit
![Page 159: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/159.jpg)
JtestRTest Java code with Ruby
Includes
RSpec (and story support)
Test::Unit
dust
![Page 160: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/160.jpg)
JtestRTest Java code with Ruby
Includes
RSpec (and story support)
Test::Unit
dust
Mocha
![Page 161: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/161.jpg)
JtestRTest Java code with Ruby
Includes
RSpec (and story support)
Test::Unit
dust
Mocha
Expectations
![Page 162: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/162.jpg)
JtestRTest Java code with Ruby
Includes
RSpec (and story support)
Test::Unit
dust
Mocha
Expectations
Ant, JUnit and Maven 2 integration
![Page 163: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/163.jpg)
JtestRTest Java code with Ruby
Includes
RSpec (and story support)
Test::Unit
dust
Mocha
Expectations
Ant, JUnit and Maven 2 integration
0.3.1 is current version
![Page 164: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/164.jpg)
DemoTesting with JtestR
![Page 165: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/165.jpg)
Rubiq
![Page 166: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/166.jpg)
RubiqLisp layer on top of JRuby
![Page 167: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/167.jpg)
RubiqLisp layer on top of JRuby
Transforms to JRuby AST
![Page 168: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/168.jpg)
RubiqLisp layer on top of JRuby
Transforms to JRuby AST
... and lets JRuby execute it
![Page 169: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/169.jpg)
RubiqLisp layer on top of JRuby
Transforms to JRuby AST
... and lets JRuby execute it
Macros
![Page 170: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/170.jpg)
RubiqLisp layer on top of JRuby
Transforms to JRuby AST
... and lets JRuby execute it
Macros
Read macros (used to implement regexp syntax, for example)
![Page 171: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/171.jpg)
RubiqLisp layer on top of JRuby
Transforms to JRuby AST
... and lets JRuby execute it
Macros
Read macros (used to implement regexp syntax, for example)
Pure lexical scoping
![Page 172: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/172.jpg)
RubiqLisp layer on top of JRuby
Transforms to JRuby AST
... and lets JRuby execute it
Macros
Read macros (used to implement regexp syntax, for example)
Pure lexical scoping
Lambdas transparently transforms to blocks or Proc.new
![Page 173: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/173.jpg)
Ruvlets
![Page 174: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/174.jpg)
RuvletsExpose Servlets as Ruby API
![Page 175: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/175.jpg)
RuvletsExpose Servlets as Ruby API
Because we can!
![Page 176: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/176.jpg)
RuvletsExpose Servlets as Ruby API
Because we can!
People keep asking for this....really!
![Page 177: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/177.jpg)
RuvletsExpose Servlets as Ruby API
Because we can!
People keep asking for this....really!
Expose highly tuned web-infrastructure to Ruby
![Page 178: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/178.jpg)
RuvletsExpose Servlets as Ruby API
Because we can!
People keep asking for this....really!
Expose highly tuned web-infrastructure to Ruby
Similar in L&F to Camping
![Page 179: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/179.jpg)
RuvletsExpose Servlets as Ruby API
Because we can!
People keep asking for this....really!
Expose highly tuned web-infrastructure to Ruby
Similar in L&F to Camping
How it works:
![Page 180: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/180.jpg)
RuvletsExpose Servlets as Ruby API
Because we can!
People keep asking for this....really!
Expose highly tuned web-infrastructure to Ruby
Similar in L&F to Camping
How it works:
Evaluates file from load path based on URL
![Page 181: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/181.jpg)
RuvletsExpose Servlets as Ruby API
Because we can!
People keep asking for this....really!
Expose highly tuned web-infrastructure to Ruby
Similar in L&F to Camping
How it works:
Evaluates file from load path based on URL
File returns an object with a 'service' method defined
![Page 182: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/182.jpg)
RuvletsExpose Servlets as Ruby API
Because we can!
People keep asking for this....really!
Expose highly tuned web-infrastructure to Ruby
Similar in L&F to Camping
How it works:
Evaluates file from load path based on URL
File returns an object with a 'service' method defined
Object cached for all future requests
![Page 183: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/183.jpg)
Bare bones Ruvlet
class HelloWorld def service(context, request, response) response.content_type = "text/html" response.writer << <<-EOF <html> <head><title>Hello World!</title></head> <body>Hello World!</body> </html> EOF endend
HelloWorld.new
![Page 184: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/184.jpg)
Swing
![Page 185: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/185.jpg)
SwingSwing API == large and complex
![Page 186: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/186.jpg)
SwingSwing API == large and complex
Ruby magic simplifies most of the tricky bits
![Page 187: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/187.jpg)
SwingSwing API == large and complex
Ruby magic simplifies most of the tricky bits
Java is a very verbose language
![Page 188: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/188.jpg)
SwingSwing API == large and complex
Ruby magic simplifies most of the tricky bits
Java is a very verbose language
Ruby makes Swing fun (more fun at least)
![Page 189: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/189.jpg)
SwingSwing API == large and complex
Ruby magic simplifies most of the tricky bits
Java is a very verbose language
Ruby makes Swing fun (more fun at least)
No consistent cross-platform GUI library for Ruby
![Page 190: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/190.jpg)
SwingSwing API == large and complex
Ruby magic simplifies most of the tricky bits
Java is a very verbose language
Ruby makes Swing fun (more fun at least)
No consistent cross-platform GUI library for Ruby
Swing works everywhere Java does
![Page 191: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/191.jpg)
Swing - the direct approachimport javax.swing.JFrameimport javax.swing.JButton
frame = JFrame.new("Swing is easy now!")frame.set_size 300, 300frame.always_on_top = true
button = JButton.new("Press me!")button.add_action_listener do |evt| evt.source.text = "Don't press me again!" evt.source.enabled = falseend
frame.add(button)frame.show
![Page 192: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/192.jpg)
Swing - Cheri (builder)include Cheri::Swing
frame = swing.frame("Swing builders!") { |form| size 300, 300 box_layout form, :Y_AXIS content_pane { background :WHITE }
button("Event binding is nice") { |btn| on_click { btn.text = "You clicked me!" } }}
frame.visible = true
![Page 193: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/193.jpg)
Swing - Profligacyclass ProfligacyDemo import javax.swing.* include Profligacy
def initialize layout = "[<translate][*input][>result]" @ui = Swing::LEL.new(JFrame, layout) {|cmps, ints| cmps.translate = JButton.new("Translate") cmps.input = JTextField.new cmps.result = JLabel.new
translator = proc {|id, evt| original = @ui.input.text translation = MyTranslator.translate(original) @ui.result.text = translation }
ints.translate = {:action => translator} } endend
![Page 194: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/194.jpg)
Swing - MonkeyBars (tools)
![Page 195: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/195.jpg)
Swing - MonkeyBars (tools)GUI editor friendly (e.g. NetBeans “Matisse”)
![Page 196: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/196.jpg)
Swing - MonkeyBars (tools)GUI editor friendly (e.g. NetBeans “Matisse”)
Simple Ruby MVC based API
![Page 197: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/197.jpg)
Swing - MonkeyBars (tools)GUI editor friendly (e.g. NetBeans “Matisse”)
Simple Ruby MVC based API
Combines best of both worlds
![Page 198: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/198.jpg)
real world
![Page 199: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/199.jpg)
Is anyone using it?
![Page 200: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/200.jpg)
Is anyone using it?Mingle (ThoughtWorks)
![Page 201: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/201.jpg)
Is anyone using it?Mingle (ThoughtWorks)
Mix (Oracle)
![Page 202: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/202.jpg)
Is anyone using it?Mingle (ThoughtWorks)
Mix (Oracle)
MediaCast (Sun)
![Page 203: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/203.jpg)
Is anyone using it?Mingle (ThoughtWorks)
Mix (Oracle)
MediaCast (Sun)
Kenai (Sun)
![Page 204: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/204.jpg)
Is anyone using it?Mingle (ThoughtWorks)
Mix (Oracle)
MediaCast (Sun)
Kenai (Sun)
Sonar (Open Source, Hortis)
![Page 205: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/205.jpg)
Monitoring
![Page 206: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/206.jpg)
Performance
![Page 207: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/207.jpg)
PerformanceHard question of course
![Page 208: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/208.jpg)
PerformanceHard question of course
Most benchmarks and apps are 2-3x faster than MRI
![Page 209: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/209.jpg)
PerformanceHard question of course
Most benchmarks and apps are 2-3x faster than MRI
Rails is on par
![Page 210: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/210.jpg)
PerformanceHard question of course
Most benchmarks and apps are 2-3x faster than MRI
Rails is on par
We are working on this
![Page 211: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/211.jpg)
0!
15!
30!
45!
60!
75!
5! 10! 15! 20! 25! 30! 35! 40! 45! 50! 55! 60! 65! 70! 75! 80! 85! 90! 95! 100!
avg
rep
ly r
ate!
request rate!
Request Scaling (1 process or runtime)!
webrick (mri)! mongrel (mri)! glassfish (jruby)!
![Page 212: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/212.jpg)
0!
50!
100!
150!
200!
250!1
5!
30!
45!
60!
75!
90!
10
5!
12
0!
13
5!
15
0!
16
5!
18
0!
19
5!
21
0!
22
5!
24
0!
25
5!
27
0!
28
5!
30
0!
Avg
rep
ly r
ate!
Request rate!
JRuby/Glassfish!
1 runtime (interpolated above 90)! 3 runtimes!
![Page 213: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/213.jpg)
the future
![Page 214: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/214.jpg)
YARV and Rubinius
![Page 215: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/215.jpg)
YARV and RubiniusYARV
![Page 216: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/216.jpg)
YARV and RubiniusYARV
2.0 Compatibility
![Page 217: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/217.jpg)
YARV and RubiniusYARV
2.0 Compatibility
Simple machine
![Page 218: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/218.jpg)
YARV and RubiniusYARV
2.0 Compatibility
Simple machine
Simple compiler
![Page 219: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/219.jpg)
YARV and RubiniusYARV
2.0 Compatibility
Simple machine
Simple compiler
Might give interpreted performance improvement
![Page 220: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/220.jpg)
YARV and RubiniusYARV
2.0 Compatibility
Simple machine
Simple compiler
Might give interpreted performance improvement
Rubinius
![Page 221: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/221.jpg)
YARV and RubiniusYARV
2.0 Compatibility
Simple machine
Simple compiler
Might give interpreted performance improvement
Rubinius
Simple machine
![Page 222: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/222.jpg)
YARV and RubiniusYARV
2.0 Compatibility
Simple machine
Simple compiler
Might give interpreted performance improvement
Rubinius
Simple machine
Quite outdated at the moment
![Page 223: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/223.jpg)
YARV and RubiniusYARV
2.0 Compatibility
Simple machine
Simple compiler
Might give interpreted performance improvement
Rubinius
Simple machine
Quite outdated at the moment
Will be redone after Rubinius C++ engine finished
![Page 224: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/224.jpg)
YARV and RubiniusYARV
2.0 Compatibility
Simple machine
Simple compiler
Might give interpreted performance improvement
Rubinius
Simple machine
Quite outdated at the moment
Will be redone after Rubinius C++ engine finished
Why do it? Why not?
![Page 225: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/225.jpg)
JSR292 and the DaVinci machine
![Page 226: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/226.jpg)
JSR292 and the DaVinci machineDynamic invocation: non-java call sites
![Page 227: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/227.jpg)
JSR292 and the DaVinci machineDynamic invocation: non-java call sites
Method handles
![Page 228: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/228.jpg)
JSR292 and the DaVinci machineDynamic invocation: non-java call sites
Method handles
Anonymous classes
![Page 229: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/229.jpg)
JSR292 and the DaVinci machineDynamic invocation: non-java call sites
Method handles
Anonymous classes
Faster reflection, escape analysis
![Page 230: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/230.jpg)
JSR292 and the DaVinci machineDynamic invocation: non-java call sites
Method handles
Anonymous classes
Faster reflection, escape analysis
Interface injection
![Page 231: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/231.jpg)
JSR292 and the DaVinci machineDynamic invocation: non-java call sites
Method handles
Anonymous classes
Faster reflection, escape analysis
Interface injection
Continuations
![Page 232: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/232.jpg)
JSR292 and the DaVinci machineDynamic invocation: non-java call sites
Method handles
Anonymous classes
Faster reflection, escape analysis
Interface injection
Continuations
Value objects (Lisp fixnums)
![Page 233: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/233.jpg)
JSR292 and the DaVinci machineDynamic invocation: non-java call sites
Method handles
Anonymous classes
Faster reflection, escape analysis
Interface injection
Continuations
Value objects (Lisp fixnums)
Tuple types
![Page 234: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/234.jpg)
JSR292 and the DaVinci machineDynamic invocation: non-java call sites
Method handles
Anonymous classes
Faster reflection, escape analysis
Interface injection
Continuations
Value objects (Lisp fixnums)
Tuple types
Tail calls
![Page 235: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/235.jpg)
JRuby future
![Page 236: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/236.jpg)
JRuby futureInterpreter
![Page 237: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/237.jpg)
JRuby futureInterpreter
Java Integration
![Page 238: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/238.jpg)
JRuby futureInterpreter
Java Integration
Ahead-of-time compilation
![Page 239: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/239.jpg)
JRuby futureInterpreter
Java Integration
Ahead-of-time compilation
More library integration
![Page 240: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/240.jpg)
![Page 241: In action!gotocon.com/dl/jaoo-aarhus-2008/slides/OlaBini_JRubyInAction.pdf · Deployment Traditional approach Pack of Mongrels N mongrels for N concurrent requests Deployed with Capistrano](https://reader036.fdocuments.us/reader036/viewer/2022071504/612443f6990f7a219b26c318/html5/thumbnails/241.jpg)
Q&AAQ and