Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
6 REASONS JUBILEE COULD BE 
A RUBYIST’S NEW BEST FRIEND 
FORREST CHANG 
@FKCHANG2000 
https://bambegin.files.wordpress.com...
APOLOGIES 
http://images.sodahead.com/blogs/000302881/sorry20really20truly20very20apology_xlarge.jpeg 
.
ALTERNATE TITLES 
AFTER SEEING 
ERNIE MILLER’S 
RUBY AFTER RAILS
! 
R A I L S W H I L E S T I L L 
USING RAILS
OR
RAILS CAN’T DO ALL THE 
STUFF I WANT ANYMORE 
AND <FILL IN THE TECH> 
MAKES ME WANT TO CRY 
http://www.louiseoneillauthor....
PRELUDE
QUESTION 
http://wp.production.patheos.com/blogs/faithwalkers/files/2013/09/god-question.jpg
WHY ARE YOU HERE AT 
RUBYCONF?
AN ANSWER
YOU LIKE RUBY
WHY DO YOU LIKE 
RUBY?
BECAUSE IT MAKES YOU 
HAPPY
“For me the purpose of life is partly to have joy. 
Programmers often feel joy when they can 
concentrate on the creative ...
“For me the purpose of life is partly to have joy. 
Programmers often feel joy when they can 
concentrate on the creative ...
HAPPINESS IS 
THE RUBY WAY
OBJECTIVE
OBJECTIVE 
• To ensure you, the Rubyist, stays happy
HAPPINESS IS A RECURRING THEME 
• J 
• D 
• D 
IN MY TALKS, AS WELL AS HERE AT RUBYCONF
HAPPINESS IS A RECURRING THEME 
• J 
Joy 
• D 
• D 
IN MY TALKS, AS WELL AS HERE AT RUBYCONF
HAPPINESS IS A RECURRING THEME 
• J 
Joy 
Driven 
• D 
• D 
IN MY TALKS, AS WELL AS HERE AT RUBYCONF
HAPPINESS IS A RECURRING THEME 
• J 
Joy 
Driven 
Development 
• D 
• D 
IN MY TALKS, AS WELL AS HERE AT RUBYCONF
CODING AND LOVING IT
WHAT DO WE LIKE 
ABOUT RUBY?
1) LANGUAGE ITSELF IS DELIGHTFUL
1) LANGUAGE ITSELF IS DELIGHTFUL 
• An entire talk can be done on this
1) LANGUAGE ITSELF IS DELIGHTFUL 
• An entire talk can be done on this 
• So I won't do one
SINGLE EXAMPLE FROM DEVISE 
CONFIG 
# ==> Configuration for :validatable! 
# Range for password length. Default is 8..128....
SINGLE EXAMPLE FROM DEVISE 
CONFIG 
# ==> Configuration for :validatable! 
# Range for password length. Default is 8..128....
SINGLE EXAMPLE FROM DEVISE 
CONFIG 
# ==> Configuration for :validatable! 
# Range for password length. Default is 8..128....
SINGLE EXAMPLE FROM DEVISE 
CONFIG 
# ==> Configuration for :validatable! 
# Range for password length. Default is 8..128....
SINGLE EXAMPLE FROM DEVISE 
CONFIG 
# ==> Configuration for :validatable! 
# Range for password length. Default is 8..128....
RUBY MAKES ME HAPPY
RUBY MAKES ME HAPPY
2) GEMS AND FRAMEWORKS
2) GEMS AND FRAMEWORKS 
• Many gems, nearly anything you'd want ready to go
2) GEMS AND FRAMEWORKS 
• Many gems, nearly anything you'd want ready to go 
• Choice, often more than 1 gem for the job
2) GEMS AND FRAMEWORKS 
• Many gems, nearly anything you'd want ready to go 
• Choice, often more than 1 gem for the job 
...
800lb Gorilla of Rubygems 
http://www.examiner.com/images/blog/wysiwyg/image/4056_Landing_gorilla-1.jpg
RAILS
RAILS 
• Who codes in Rails?
RAILS 
• Who codes in Rails? 
• Who came to Ruby from Rails?
RAILS 
• Who codes in Rails? 
• Who came to Ruby from Rails? 
• Who was coding Ruby before Rails?
RAILS 
• Who codes in Rails? 
• Who came to Ruby from Rails? 
• Who was coding Ruby before Rails? 
• Who loves Rails?
RAILS 
• Who codes in Rails? 
• Who came to Ruby from Rails? 
• Who was coding Ruby before Rails? 
• Who loves Rails? 
• W...
WHY WE LOVE RAILS
WHY WE LOVE RAILS 
• A whole talk can be done this
WHY WE LOVE RAILS 
• A whole talk can be done this 
• So I won't do one
WHY WE LOVE RAILS 
• A whole talk can be done this 
• So I won't do one 
• Productivity
WHY WE LOVE RAILS 
• A whole talk can be done this 
• So I won't do one 
• Productivity 
• Programmer interface - Omokase,...
RAILS CAN MAKES YOU HAPPY
RAILS CAN MAKES YOU HAPPY
RUBY IS NOT A 
PANACEA
SOME REASONS TO NOT USE RUBY
SOME REASONS TO NOT USE RUBY 
• Speed
SOME REASONS TO NOT USE RUBY 
• Speed 
• Image processing, video encoding
SOME REASONS TO NOT USE RUBY 
• Speed 
• Image processing, video encoding 
• Scaling
SOME REASONS TO NOT USE RUBY 
• Speed 
• Image processing, video encoding 
• Scaling 
• Resource heavy
SOME REASONS TO NOT USE RUBY 
• Speed 
• Image processing, video encoding 
• Scaling 
• Resource heavy 
• Computation heav...
SOME REASONS TO NOT USE RUBY 
• Speed 
• Image processing, video encoding 
• Scaling 
• Resource heavy 
• Computation heav...
SOME REASONS TO NOT USE RUBY 
• Speed 
• Image processing, video encoding 
• Scaling 
• Resource heavy 
• Computation heav...
ALL LEGIT REASONS
PROBLEM
PROBLEM 
Some non Ruby technologies can be “Less Happy Making”
A COMMON ALTERNATIVE
NODE, WHAT IT IS GOOD FOR?
NODE, WHAT IT IS GOOD FOR?
NODE, WHAT IT IS GOOD FOR? 
• Quick, Non blocking I/O
NODE, WHAT IT IS GOOD FOR? 
• Quick, Non blocking I/O 
• Concurrency
NODE, WHAT IT IS GOOD FOR? 
• Quick, Non blocking I/O 
• Concurrency 
• Chat app demonstrates Node’s sweet spot
NODE, WHAT IT IS GOOD FOR? 
• Quick, Non blocking I/O 
• Concurrency 
• Chat app demonstrates Node’s sweet spot 
• high co...
NODE, WHAT IT IS GOOD FOR? 
• Quick, Non blocking I/O 
• Concurrency 
• Chat app demonstrates Node’s sweet spot 
• high co...
NODE, WHAT IT IS GOOD FOR? 
• Quick, Non blocking I/O 
• Concurrency 
• Chat app demonstrates Node’s sweet spot 
• high co...
NODE, WHAT IT IS GOOD FOR? 
• Quick, Non blocking I/O 
• Concurrency 
• Chat app demonstrates Node’s sweet spot 
• high co...
WHAT IT NODE BAD AT?
WHAT IT NODE BAD AT? 
• Vertical scaling
WHAT IT NODE BAD AT? 
• Vertical scaling 
• CPU intensive
WHAT IT NODE BAD AT? 
• Vertical scaling 
• CPU intensive 
• Integration with other systems
WHAT IT NODE BAD AT? 
• Vertical scaling 
• CPU intensive 
• Integration with other systems 
• Decent language (Ruby bias)
TOO MUCH JAVASCRIPT 
AND
SO, HOW DO WE
BRING BACK THAT LOVING 
FEELING?
BRING BACK THAT LOVING 
FEELING?
• Who's heard of it?
• Who's heard of it? 
• Oversimplified - Node for the JVM
• Who's heard of it? 
• Oversimplified - Node for the JVM 
• BUT much more - more like Node++ and then some
DESIGNED FOR MODERN APPLICATIONS
DESIGNED FOR MODERN APPLICATIONS
DESIGNED FOR MODERN APPLICATIONS 
Ruby/ 
JRuby
DESIGNED FOR MODERN APPLICATIONS 
Ruby/ 
JRuby
DESIGNED FOR MODERN APPLICATIONS 
Ruby/ 
JRuby
DESIGNED FOR MODERN APPLICATIONS 
Ruby/ 
JRuby
SOME KEY FEATURES
SOME KEY FEATURES
SOME KEY FEATURES
SOME KEY FEATURES
SOME KEY FEATURES
LIKE NODE
LIKE NODE 
• Concurrency - Implements the same Reactor Pattern
LIKE NODE 
• Concurrency - Implements the same Reactor Pattern 
• Non blocking i/o
LIKE NODE 
• Concurrency - Implements the same Reactor Pattern 
• Non blocking i/o 
• Fast
BETTER THAN NODE
BETTER THAN NODE 
• Handles CPU intensive
BETTER THAN NODE 
• Handles CPU intensive 
• JVM fast (JRuby fastes of the Rubies)
BETTER THAN NODE 
• Handles CPU intensive 
• JVM fast (JRuby fastes of the Rubies) 
• JVM thread friendly
BETTER THAN NODE 
• Handles CPU intensive 
• JVM fast (JRuby fastes of the Rubies) 
• JVM thread friendly 
• Handles Block...
BETTER THAN NODE 
• Handles CPU intensive 
• JVM fast (JRuby fastes of the Rubies) 
• JVM thread friendly 
• Handles Block...
BETTER THAN NODE 
• Handles CPU intensive 
• JVM fast (JRuby fastes of the Rubies) 
• JVM thread friendly 
• Handles Block...
BETTER THAN NODE 
• Handles CPU intensive 
• JVM fast (JRuby fastes of the Rubies) 
• JVM thread friendly 
• Handles Block...
BETTER THAN NODE 
• Handles CPU intensive 
• JVM fast (JRuby fastes of the Rubies) 
• JVM thread friendly 
• Handles Block...
BETTER THAN NODE, PART 2
BETTER THAN NODE, PART 2 
• Polyglot
BETTER THAN NODE, PART 2 
• Polyglot 
• Official idiomatic API support: Java, Javascript, Groovy, 
Coffeescript, *Ruby (by...
BETTER THAN NODE, PART 2 
• Polyglot 
• Official idiomatic API support: Java, Javascript, Groovy, 
Coffeescript, *Ruby (by...
BETTER THAN NODE, PART 2 
• Polyglot 
• Official idiomatic API support: Java, Javascript, Groovy, 
Coffeescript, *Ruby (by...
BETTER THAN NODE, PART 2 
• Polyglot 
• Official idiomatic API support: Java, Javascript, Groovy, 
Coffeescript, *Ruby (by...
BETTER THAN NODE, PART 2 
• Polyglot 
• Official idiomatic API support: Java, Javascript, Groovy, 
Coffeescript, *Ruby (by...
BETTER THAN NODE, PART 2 
• Polyglot 
• Official idiomatic API support: Java, Javascript, Groovy, 
Coffeescript, *Ruby (by...
BETTER THAN NODE, PART 3
BETTER THAN NODE, PART 3 
• Designed to build systems of systems
BETTER THAN NODE, PART 3 
• Designed to build systems of systems 
• Easy High Availability
BETTER THAN NODE, PART 3 
• Designed to build systems of systems 
• Easy High Availability 
• Easy Clustering
BETTER THAN NODE, PART 3 
• Designed to build systems of systems 
• Easy High Availability 
• Easy Clustering 
• Easy subs...
BETTER THAN NODE, PART 3 
• Designed to build systems of systems 
• Easy High Availability 
• Easy Clustering 
• Easy subs...
BETTER THAN NODE, PART 3 
• Designed to build systems of systems 
• Easy High Availability 
• Easy Clustering 
• Easy subs...
CORE APIS- WHAT YOU NEED
CORE APIS- WHAT YOU NEED 
• TCP/SSL clients and servers
CORE APIS- WHAT YOU NEED 
• TCP/SSL clients and servers 
• HTTP/HTTPS clients and servers
CORE APIS- WHAT YOU NEED 
• TCP/SSL clients and servers 
• HTTP/HTTPS clients and servers 
• Websockets
CORE APIS- WHAT YOU NEED 
• TCP/SSL clients and servers 
• HTTP/HTTPS clients and servers 
• Websockets 
• SockJS
CORE APIS- WHAT YOU NEED 
• TCP/SSL clients and servers 
• HTTP/HTTPS clients and servers 
• Websockets 
• SockJS 
• File ...
CORE APIS- WHAT YOU NEED 
• TCP/SSL clients and servers 
• HTTP/HTTPS clients and servers 
• Websockets 
• SockJS 
• File ...
CORE APIS- WHAT YOU NEED 
• TCP/SSL clients and servers 
• HTTP/HTTPS clients and servers 
• Websockets 
• SockJS 
• File ...
CORE APIS- WHAT YOU NEED 
• TCP/SSL clients and servers 
• HTTP/HTTPS clients and servers 
• Websockets 
• SockJS 
• File ...
DUCT TAPE
DUCT TAPE 
• Open SourceSystems are duct taped together
DUCT TAPE 
• Open SourceSystems are duct taped together 
• We figure out how to do to put together things
DUCT TAPE 
• Open SourceSystems are duct taped together 
• We figure out how to do to put together things 
• Perl used to ...
DUCT TAPE 
• Open SourceSystems are duct taped together 
• We figure out how to do to put together things 
• Perl used to ...
DUCT TAPE 
• Open SourceSystems are duct taped together 
• We figure out how to do to put together things 
• Perl used to ...
VERT.X DESIGNED FOR 
INTEGRATED SYSTEMS
DIFFERENT TYPES OF PROCESSES
DIFFERENT TYPES OF PROCESSES 
• Asynchronous - Verticle
DIFFERENT TYPES OF PROCESSES 
• Asynchronous - Verticle 
• Blocking/CPU intensive - worker verticle
INTER PROCESS/SYSTEM 
COMMUNICATION
INTER PROCESS/SYSTEM 
COMMUNICATION 
• Event Bus
INTER PROCESS/SYSTEM 
COMMUNICATION 
• Event Bus 
• publish
INTER PROCESS/SYSTEM 
COMMUNICATION 
• Event Bus 
• publish 
• direct message
INTER PROCESS/SYSTEM 
COMMUNICATION 
• Event Bus 
• publish 
• direct message 
• direct message reply
INTER PROCESS/SYSTEM 
COMMUNICATION 
• Event Bus 
• publish 
• direct message 
• direct message reply 
• extends into the ...
INTER PROCESS/SYSTEM 
COMMUNICATION 
• Event Bus 
• publish 
• direct message 
• direct message reply 
• extends into the ...
INTER PROCESS/SYSTEM 
COMMUNICATION 
• Event Bus 
• publish 
• direct message 
• direct message reply 
• extends into the ...
INTER PROCESS/SYSTEM 
COMMUNICATION 
• Event Bus 
• publish 
• direct message 
• direct message reply 
• extends into the ...
SCALING BUILT I N
SCALING BUILT I N 
• Clustering
SCALING BUILT I N 
• Clustering 
• vertx process.rb —cluster
SCALING BUILT I N 
• Clustering 
• vertx process.rb —cluster 
• High Availability
SCALING BUILT I N 
• Clustering 
• vertx process.rb —cluster 
• High Availability 
• vertx process.rb —ha
AND MUCH MORE
AND MUCH MORE 
• A whole talk could be done on it
AND MUCH MORE 
• A whole talk could be done on it 
• So I won’t do one
AND MUCH MORE 
• A whole talk could be done on it 
• So I won’t do one 
• 2 Good overview videos
AND MUCH MORE 
• A whole talk could be done on it 
• So I won’t do one 
• 2 Good overview videos 
• Tim Fox: Introducing V...
AND MUCH MORE 
• A whole talk could be done on it 
• So I won’t do one 
• 2 Good overview videos 
• Tim Fox: Introducing V...
AND MUCH MORE 
• A whole talk could be done on it 
• So I won’t do one 
• 2 Good overview videos 
• Tim Fox: Introducing V...
AND MUCH MORE 
• A whole talk could be done on it 
• So I won’t do one 
• 2 Good overview videos 
• Tim Fox: Introducing V...
VERT. X I S P R E T T Y AWESOME
VERT. X I S P R E T T Y AWESOME
BUT IT’S MORE STUFF TO 
LEARN
WHAT IF I TOLD YOU YOU COULD?
ORIGINAL JUBILEE README SLOGAN
ORIGINAL JUBILEE README SLOGAN 
"We need a web framework for Vertx.", you said.
ORIGINAL JUBILEE README SLOGAN 
"We need a web framework for Vertx.", you said. 
"But why not use Vertx in your Rails appl...
JUBILEE
JUBILEE 
• Originally Rack server w/ vert.x 2.0 built in
JUBILEE 
• Originally Rack server w/ vert.x 2.0 built in 
• Now a Vert.x module that runs Rack
JUBILEE 
• Originally Rack server w/ vert.x 2.0 built in 
• Now a Vert.x module that runs Rack 
• improved performance and...
JUBILEE 
• Originally Rack server w/ vert.x 2.0 built in 
• Now a Vert.x module that runs Rack 
• improved performance and...
JUBILEE 
• Originally Rack server w/ vert.x 2.0 built in 
• Now a Vert.x module that runs Rack 
• improved performance and...
6 REASONS VERT.X COULD BE YOUR 
NEW BEST FRIEND
6 REASONS VERT.X COULD BE YOUR 
NEW BEST FRIEND 
• Concurrency
6 REASONS VERT.X COULD BE YOUR 
NEW BEST FRIEND 
• Concurrency 
• Speed
6 REASONS VERT.X COULD BE YOUR 
NEW BEST FRIEND 
• Concurrency 
• Speed 
• Expanded Ecosystem
6 REASONS VERT.X COULD BE YOUR 
NEW BEST FRIEND 
• Concurrency 
• Speed 
• Expanded Ecosystem 
• Built in upgrade/scaling ...
6 REASONS VERT.X COULD BE YOUR 
NEW BEST FRIEND 
• Concurrency 
• Speed 
• Expanded Ecosystem 
• Built in upgrade/scaling ...
6 REASONS VERT.X COULD BE YOUR 
NEW BEST FRIEND 
• Concurrency 
• Speed 
• Expanded Ecosystem 
• Built in upgrade/scaling ...
1) CONCURRENCY
1) CONCURRENCY 
• Same Reactor pattern as Node
1) CONCURRENCY 
• Same Reactor pattern as Node 
• Each Verticle single threaded
1) CONCURRENCY 
• Same Reactor pattern as Node 
• Each Verticle single threaded 
• Simple concurrency model, no threading
1) CONCURRENCY 
• Same Reactor pattern as Node 
• Each Verticle single threaded 
• Simple concurrency model, no threading ...
2) SPEED
2) SPEED 
• JVM faster and getting faster all the time
2) SPEED 
• JVM faster and getting faster all the time 
• Can use threads, cpus
2) SPEED 
• JVM faster and getting faster all the time 
• Can use threads, cpus 
• Benchmarks
LIES, DAMN LIES, AND BENCHMARKS
LIES, DAMN LIES, AND BENCHMARKS 
• http://vertxproject.wordpress.com/2012/05/09/vert-x-vs-node-js-simple-http-benchmarks/
LIES, DAMN LIES, AND BENCHMARKS 
• http://vertxproject.wordpress.com/2012/05/09/vert-x-vs-node-js-simple-http-benchmarks/ ...
LIES, DAMN LIES, AND BENCHMARKS 
• http://vertxproject.wordpress.com/2012/05/09/vert-x-vs-node-js-simple-http-benchmarks/ ...
LIES, DAMN LIES, AND BENCHMARKS 
• http://vertxproject.wordpress.com/2012/05/09/vert-x-vs-node-js-simple-http-benchmarks/ ...
Ruby
Ruby 
Best Node
JUBILEE - 2ND FASTEST RUBY SERVER
JUBILEE - 2ND FASTEST RUBY SERVER 
• http://www.madebymarket.com/blog/dev/ruby-web-benchmark- 
report.html
JUBILEE - 2ND FASTEST RUBY SERVER 
• http://www.madebymarket.com/blog/dev/ruby-web-benchmark- 
report.html 
• Maximum spee...
JUBILEE - 2ND FASTEST RUBY SERVER 
• http://www.madebymarket.com/blog/dev/ruby-web-benchmark- 
report.html 
• Maximum spee...
JUBILEE - 2ND FASTEST RUBY SERVER 
• http://www.madebymarket.com/blog/dev/ruby-web-benchmark- 
report.html 
• Maximum spee...
Golang hello world was 10,500 reqs/sec
3 ) E X PANDED ECOSYSTEM
3 ) E X PANDED ECOSYSTEM 
• Rubygems
3 ) E X PANDED ECOSYSTEM 
• Rubygems 
• Must run under JRuby
3 ) E X PANDED ECOSYSTEM 
• Rubygems 
• Must run under JRuby 
• Vertx modules (200 at time of writing)
3 ) E X PANDED ECOSYSTEM 
• Rubygems 
• Must run under JRuby 
• Vertx modules (200 at time of writing) 
• Entire JVM ecosy...
3 ) E X PANDED ECOSYSTEM 
• Rubygems 
• Must run under JRuby 
• Vertx modules (200 at time of writing) 
• Entire JVM ecosy...
3 ) E X PANDED ECOSYSTEM 
• Rubygems 
• Must run under JRuby 
• Vertx modules (200 at time of writing) 
• Entire JVM ecosy...
4 ) BUILT IN UPGRADE/SCALING PATH
4 ) BUILT IN UPGRADE/SCALING PATH 
• Designed for multiple verticles (async)
4 ) BUILT IN UPGRADE/SCALING PATH 
• Designed for multiple verticles (async) 
• Worker verticles (slow)
4 ) BUILT IN UPGRADE/SCALING PATH 
• Designed for multiple verticles (async) 
• Worker verticles (slow) 
• Inter communica...
4 ) BUILT IN UPGRADE/SCALING PATH 
• Designed for multiple verticles (async) 
• Worker verticles (slow) 
• Inter communica...
4 ) BUILT IN UPGRADE/SCALING PATH 
• Designed for multiple verticles (async) 
• Worker verticles (slow) 
• Inter communica...
4 ) BUILT IN UPGRADE/SCALING PATH 
• Designed for multiple verticles (async) 
• Worker verticles (slow) 
• Inter communica...
4 ) BUILT IN UPGRADE/SCALING PATH 
• Designed for multiple verticles (async) 
• Worker verticles (slow) 
• Inter communica...
4 ) BUILT IN UPGRADE/SCALING PATH 
• Designed for multiple verticles (async) 
• Worker verticles (slow) 
• Inter communica...
5) EASY WEBSOCKETS SUPPORT
5) EASY WEBSOCKETS SUPPORT 
• SocketIO support
5) EASY WEBSOCKETS SUPPORT 
• SocketIO support 
• SockJS support
5) EASY WEBSOCKETS SUPPORT 
• SocketIO support 
• SockJS support 
• ** Event Bus **
5) EASY WEBSOCKETS SUPPORT 
• SocketIO support 
• SockJS support 
• ** Event Bus ** 
• Easy
5) EASY WEBSOCKETS SUPPORT 
• SocketIO support 
• SockJS support 
• ** Event Bus ** 
• Easy 
• Extends into the browser
6 ) REUSE ALL YOUR EXISTING KNOWLEDGE/ 
RESOURCES
6 ) REUSE ALL YOUR EXISTING KNOWLEDGE/ 
RESOURCES 
• Ruby
6 ) REUSE ALL YOUR EXISTING KNOWLEDGE/ 
RESOURCES 
• Ruby 
• Rack programming
6 ) REUSE ALL YOUR EXISTING KNOWLEDGE/ 
RESOURCES 
• Ruby 
• Rack programming 
• i.e. Rails, Sinatra, etc.
6 ) REUSE ALL YOUR EXISTING KNOWLEDGE/ 
RESOURCES 
• Ruby 
• Rack programming 
• i.e. Rails, Sinatra, etc. 
• Gems
6 ) REUSE ALL YOUR EXISTING KNOWLEDGE/ 
RESOURCES 
• Ruby 
• Rack programming 
• i.e. Rails, Sinatra, etc. 
• Gems 
• Low ...
JUBILEE CAN MAKE YOU HAPPY
JUBILEE CAN MAKE YOU HAPPY
INSTALLATION 
$ gem install jubilee!
RUNNING WITH RACK 
$ cd a-jruby-compatible-rack-app! 
# Start it, several options available! 
$ jubilee <options> ! 
# If ...
WHAT ABOUT HEROKU?
WHAT ABOUT HEROKU? 
• http://funkworks.blogspot.com/2014/08/deploying-rails-41-app-served-by.html
WHAT ABOUT HEROKU? 
• http://funkworks.blogspot.com/2014/08/deploying-rails-41-app-served-by.html 
Gemfile 
ruby '2.0.0', ...
WHAT ABOUT HEROKU? 
• http://funkworks.blogspot.com/2014/08/deploying-rails-41-app-served-by.html 
Gemfile 
ruby '2.0.0', ...
WHAT ABOUT HEROKU? 
• http://funkworks.blogspot.com/2014/08/deploying-rails-41-app-served-by.html 
Gemfile 
ruby '2.0.0', ...
GETTING THE MESSAGE ACROSS
GETTING THE MESSAGE ACROSS 
• Everyone has slides
GETTING THE MESSAGE ACROSS 
• Everyone has slides 
• Many have demos
GETTING THE MESSAGE ACROSS 
• Everyone has slides 
• Many have demos 
• I want 1st hand interaction -
AN EXPERIENCE
AN EXPERIENCE
NODE’S SWEET SPOT
NODE’S SWEET SPOT 
• Chat - The sample app that everyone makes
NODE’S SWEET SPOT 
• Chat - The sample app that everyone makes 
• How do I make a chat app a little more interesting?
NODE’S SWEET SPOT 
• Chat - The sample app that everyone makes 
• How do I make a chat app a little more interesting? 
• H...
MMO WHAT?
MMO WHAT? 
• Rock, Paper, Scissors
MMO WHAT? 
• Rock, Paper, Scissors 
• Really!
MMO WHAT? 
• Rock, Paper, Scissors 
• Really! 
• 4 kids, demanding job - World of Warcraft is out
EXPERIENCING JUBILEE IN ACTION
EXPERIENCING JUBILEE IN ACTION 
• Everyone in the room sign on
EXPERIENCING JUBILEE IN ACTION 
• Everyone in the room sign on 
• Play each other
EXPERIENCING JUBILEE IN ACTION 
• Everyone in the room sign on 
• Play each other 
• Have fun!
EXPERIENCING JUBILEE IN ACTION 
• Everyone in the room sign on 
• Play each other 
• Have fun! 
• Then we talk
EXPERIENCING JUBILEE IN ACTION 
• Everyone in the room sign on 
• Play each other 
• Have fun! 
• Then we talk 
• EXPERIME...
EXPERIENCING JUBILEE IN ACTION 
• Everyone in the room sign on 
• Play each other 
• Have fun! 
• Then we talk 
• EXPERIME...
EXPERIENCING JUBILEE IN ACTION 
• Everyone in the room sign on 
• Play each other 
• Have fun! 
• Then we talk 
• EXPERIME...
ROCK 
R 
P 
PAPER 
S 
SCISSORS 
MAYHEM 
M
R 
P 
S 
M
! 
P 
HTTP://BIT. LY/RPSMAYHEM 
! 
! 
! 
! 
M 
! 
! 
R S
WHAT TO DO
WHAT TO DO 
• Go to http://bit.ly/rpsmayhem
WHAT TO DO 
• Go to http://bit.ly/rpsmayhem 
• Login with twitter
WHAT TO DO 
• Go to http://bit.ly/rpsmayhem 
• Login with twitter 
• Android users click the “Play Sound” button to prime ...
WHAT TO DO 
• Go to http://bit.ly/rpsmayhem 
• Login with twitter 
• Android users click the “Play Sound” button to prime ...
WHAT TO DO 
• Go to http://bit.ly/rpsmayhem 
• Login with twitter 
• Android users click the “Play Sound” button to prime ...
WHAT TO DO 
• Go to http://bit.ly/rpsmayhem 
• Login with twitter 
• Android users click the “Play Sound” button to prime ...
WHAT TO DO 
• Go to http://bit.ly/rpsmayhem 
• Login with twitter 
• Android users click the “Play Sound” button to prime ...
PLAY I T !
APP BREAKDOWN
RIGHT TOOL FOR THE JOB
RIGHT TOOL FOR THE JOB 
• Rails
RIGHT TOOL FOR THE JOB 
• Rails 
• Login - omniauth, devise
RIGHT TOOL FOR THE JOB 
• Rails 
• Login - omniauth, devise 
• Views - haml
RIGHT TOOL FOR THE JOB 
• Rails 
• Login - omniauth, devise 
• Views - haml 
• DB - ActiveRecord, migrations
RIGHT TOOL FOR THE JOB 
• Rails 
• Login - omniauth, devise 
• Views - haml 
• DB - ActiveRecord, migrations 
• Jubilee/Ve...
RIGHT TOOL FOR THE JOB 
• Rails 
• Login - omniauth, devise 
• Views - haml 
• DB - ActiveRecord, migrations 
• Jubilee/Ve...
RIGHT TOOL FOR THE JOB 
• Rails 
• Login - omniauth, devise 
• Views - haml 
• DB - ActiveRecord, migrations 
• Jubilee/Ve...
RIGHT TOOL FOR THE JOB 
• Rails 
• Login - omniauth, devise 
• Views - haml 
• DB - ActiveRecord, migrations 
• Jubilee/Ve...
RIGHT TOOL FOR THE JOB 
• Rails 
• Login - omniauth, devise 
• Views - haml 
• DB - ActiveRecord, migrations 
• Jubilee/Ve...
RIGHT TOOL FOR THE JOB 
• Rails 
• Login - omniauth, devise 
• Views - haml 
• DB - ActiveRecord, migrations 
• Jubilee/Ve...
APP SUMMARY
APP SUMMARY 
• Rails to get to the game
APP SUMMARY 
• Rails to get to the game 
• Jubilee/Vert.x to play the game
SCREEN BY SCREEN
MAIN PAGE
MAIN PAGE 
Main page is vanilla Rails 
Sign in
SIGN IN WITH TWITTER
SIGN IN WITH TWITTER 
Omniauth gem makes it easy
CHAT LIKE FEATURES OF THE GAME
CHAT LIKE FEATURES OF THE GAME 
You
CHAT LIKE FEATURES OF THE GAME 
You 
Live Activity Stream
CHAT LIKE FEATURES OF THE GAME 
You 
Live Activity Stream 
Live presence 
and state
CHALLENGE AN OPPONENT 
You can give up
CHALLENGE TIME OUT 
Jubilee/Vert.x Timer 
checks and cancels the 
challenge
REALTIME CHALLENGE
REALTIME CHALLENGE 
Connected to server and 
each other by EventBus
CHALLENGE TIME OUT
CHALLENGE TIME OUT 
Jubilee/Vert.x Timer 
checks and cancels the 
challenge
REALTIME MMO GAMEPLAY
REALTIME MMO GAMEPLAY 
Connected to server and 
each other by EventBus, 
uses SharedData for speed
REALTIME MMO GAMEPLAY 
Connected to server and 
each other by EventBus, 
uses SharedData for speed 
The bot is it’s own 
V...
ARCHITECTURE IN 1 DYNO 
RAILS 
EVENT 
BOT BUS 
SVR 
SHARED 
DATA 
BROWSER 
CLIENT 
TIMERS
ARCHITECTURE IN 1 DYNO 
Normal Rails App 
RAILS 
EVENT 
BOT BUS 
SVR 
SHARED 
DATA 
BROWSER 
CLIENT 
TIMERS
ARCHITECTURE IN 1 DYNO 
Normal Rails App 
RAILS 
EVENT 
BOT BUS 
SVR 
SHARED 
DATA 
BROWSER 
CLIENT 
Rabbit MQ or similar ...
ARCHITECTURE IN 1 DYNO 
Normal Rails App 
RAILS 
EVENT 
BOT BUS 
SVR 
SHARED 
DATA 
BROWSER 
CLIENT 
TIMERS 
Server is Eve...
ARCHITECTURE IN 1 DYNO 
Normal Rails App 
RAILS 
EVENT 
BOT BUS 
Redis, Tokyo Cabinet, etc. Rabbit MQ or similar 
SVR 
SHA...
ARCHITECTURE IN 1 DYNO 
Normal Rails App 
RAILS 
EVENT 
BOT BUS 
Redis, Tokyo Cabinet, etc. Rabbit MQ or similar 
SVR 
SHA...
ARCHITECTURE IN 1 DYNO 
Normal Rails App 
RAILS 
EVENT 
Bot Verticle would be 
another process 
BOT BUS 
Redis, Tokyo Cabi...
ARCHITECTURE IN 1 DYNO 
Normal Rails App 
RAILS 
EVENT 
Bot Verticle would be 
another process 
BOT BUS 
Redis, Tokyo Cabi...
DESIGNED TO WORK 
TOGETHER
AS OPPOSED TO DUCT 
TAPED TOGETHER
DUCT TAPE
APP CODE STATS
APP CODE STATS 
• Client code 497 LOC Opal (including whitespace and 
debug)
APP CODE STATS 
• Client code 497 LOC Opal (including whitespace and 
debug) 
• game.js.rb 444
APP CODE STATS 
• Client code 497 LOC Opal (including whitespace and 
debug) 
• game.js.rb 444 
• event_bus.rb 52
APP CODE STATS 
• Client code 497 LOC Opal (including whitespace and 
debug) 
• game.js.rb 444 
• event_bus.rb 52 
• Serve...
CODE
CODE 
• Rails code - typical stuff you’re already doing - don’t need to see
CODE 
• Rails code - typical stuff you’re already doing - don’t need to see 
• Client Game code - similar to what you migh...
CODE 
• Rails code - typical stuff you’re already doing - don’t need to see 
• Client Game code - similar to what you migh...
CODE 
• Rails code - typical stuff you’re already doing - don’t need to see 
• Client Game code - similar to what you migh...
CODE 
• Rails code - typical stuff you’re already doing - don’t need to see 
• Client Game code - similar to what you migh...
CODE 
• Rails code - typical stuff you’re already doing - don’t need to see 
• Client Game code - similar to what you migh...
CODE 
• Rails code - typical stuff you’re already doing - don’t need to see 
• Client Game code - similar to what you migh...
EVENTBUS SETUP - RAILS 
begin! 
require 'vertx'! 
def to_array(shared_set)! 
ret = []! 
shared_set.each{ |item| ret << ite...
EVENTBUS SETUP - RAILS 
begin! 
require 'vertx'! 
def to_array(shared_set)! 
ret = []! 
shared_set.each{ |item| ret << ite...
EVENTBUS SETUP - RAILS 
begin! 
require 'vertx'! 
def to_array(shared_set)! 
ret = []! 
shared_set.each{ |item| ret << ite...
EVENTBUS SETUP - RAILS 
begin! 
require 'vertx'! 
def to_array(shared_set)! 
ret = []! 
shared_set.each{ |item| ret << ite...
EVENTBUS SETUP - RAILS 
begin! 
require 'vertx'! 
def to_array(shared_set)! 
ret = []! 
shared_set.each{ |item| ret << ite...
EVENTBUS SETUP - RAILS 
begin! 
require 'vertx'! 
def to_array(shared_set)! 
ret = []! 
shared_set.each{ |item| ret << ite...
SERVER CONTINUED 
begin! 
Vertx::EventBus.register_handler('game') do |message|! 
server = Server.new(Vertx::EventBus, Ver...
SERVER CONTINUED 
begin! 
Vertx::EventBus.register_handler('game') do |message|! 
server = Server.new(Vertx::EventBus, Ver...
SERVER CONTINUED 
begin! 
Vertx::EventBus.register_handler('game') do |message|! 
server = Server.new(Vertx::EventBus, Ver...
CLIENT SIDE EVENTBUS SETUP (OPAL) 
def setup_eventbus! 
@event_bus = EventBus.new! 
@event_bus.onopen {! 
@event_bus.send_...
CLIENT SIDE EVENTBUS SETUP (OPAL) 
def setup_eventbus! 
@event_bus = EventBus.new! 
@event_bus.onopen {! 
@event_bus.send_...
CLIENT SIDE EVENTBUS SETUP (OPAL) 
def setup_eventbus! 
@event_bus = EventBus.new! 
@event_bus.onopen {! 
@event_bus.send_...
CLIENT SIDE EVENTBUS SETUP (OPAL) 
def setup_eventbus! 
@event_bus = EventBus.new! 
@event_bus.onopen {! 
@event_bus.send_...
CLIENT CONTINUED 
@event_bus.register_handler(@uid) do |data|! 
cmd_hash = Native(data)! 
case cmd_hash["cmd"]! 
when "cha...
def cont! 
@event_bus.register_handler(:activity) do |data|! 
append_activity(data)! 
end! 
@event_bus.register_handler(:p...
BOT CODE 
@handler = Vertx::EventBus.register_handler(BOT_ID) do |message|! 
cmd_hash = message.body! 
puts "nBOT handling...
BOT CODE 
@handler = Vertx::EventBus.register_handler(BOT_ID) do |message|! 
cmd_hash = message.body! 
puts "nBOT handling...
BOT CODE 
@handler = Vertx::EventBus.register_handler(BOT_ID) do |message|! 
cmd_hash = message.body! 
puts "nBOT handling...
BOT CODE 
@handler = Vertx::EventBus.register_handler(BOT_ID) do |message|! 
cmd_hash = message.body! 
puts "nBOT handling...
SERVER TIMER CODE 
# timer when challenged! 
timer_id = @container.set_timer(10000) do |timer_id|! 
check_accepted?(challe...
SERVER TIMER CODE 
# timer when challenged! 
timer_id = @container.set_timer(10000) do |timer_id|! 
check_accepted?(challe...
SERVER TIMER CODE 
# timer when challenged! 
timer_id = @container.set_timer(10000) do |timer_id|! 
check_accepted?(challe...
SERVER TIMER CODE 
# timer when challenged! 
timer_id = @container.set_timer(10000) do |timer_id|! 
check_accepted?(challe...
SERVER TIMER CODE 
# timer when challenged! 
timer_id = @container.set_timer(10000) do |timer_id|! 
check_accepted?(challe...
SERVER TIMER CODE 
# timer when challenged! 
timer_id = @container.set_timer(10000) do |timer_id|! 
check_accepted?(challe...
JUBILEE CONSIDERATIONS IN RAILS
JUBILEE CONSIDERATIONS IN RAILS 
• Setup server side EventBus in Rails initializer
JUBILEE CONSIDERATIONS IN RAILS 
• Setup server side EventBus in Rails initializer 
• Done in initializer so it is done fo...
JUBILEE CONSIDERATIONS IN RAILS 
• Setup server side EventBus in Rails initializer 
• Done in initializer so it is done fo...
DRAWBACKS
DRAWBACKS 
• JRuby still 2nd class citizen, sometime have gem trouble or 
hard to get the config right
DRAWBACKS 
• JRuby still 2nd class citizen, sometime have gem trouble or 
hard to get the config right 
• Debugging asynch...
DRAWBACKS 
• JRuby still 2nd class citizen, sometime have gem trouble or 
hard to get the config right 
• Debugging asynch...
DRAWBACKS 
• JRuby still 2nd class citizen, sometime have gem trouble or 
hard to get the config right 
• Debugging asynch...
DRAWBACKS 
• JRuby still 2nd class citizen, sometime have gem trouble or 
hard to get the config right 
• Debugging asynch...
ONE MORE THING
ONE MORE THING 
• Opal (Ruby in the browser) front end == All Ruby Stack
ONE MORE THING 
• Opal (Ruby in the browser) front end == All Ruby Stack 
• The same language on front end/back end advant...
ONE MORE THING 
• Opal (Ruby in the browser) front end == All Ruby Stack 
• The same language on front end/back end advant...
ONE MORE THING 
• Opal (Ruby in the browser) front end == All Ruby Stack 
• The same language on front end/back end advant...
RUBY IN THE BROWSER MAKES ME 
HAPPY
RUBY IN THE BROWSER MAKES ME 
HAPPY
THANKS 
• Matz - Ruby 
• DHH - Rails and jobs 
• Charles Nutter, Tom Enebo - JRuby 
• Tim Fox & Vert.x team - Vert.x 
• Is...
ADVICE TO RUBYISTS
ADVICE TO RUBYISTS 
• Stay happy, you can still do most of your stuff in Ruby 
via Jubilee
ADVICE TO RUBYISTS 
• Stay happy, you can still do most of your stuff in Ruby 
via Jubilee 
• Stay happy, you can grow/sca...
ADVICE TO RUBYISTS 
• Stay happy, you can still do most of your stuff in Ruby 
via Jubilee 
• Stay happy, you can grow/sca...
6 reasons Jubilee could be a Rubyist's new best friend
6 reasons Jubilee could be a Rubyist's new best friend
6 reasons Jubilee could be a Rubyist's new best friend
6 reasons Jubilee could be a Rubyist's new best friend
6 reasons Jubilee could be a Rubyist's new best friend
6 reasons Jubilee could be a Rubyist's new best friend
6 reasons Jubilee could be a Rubyist's new best friend
6 reasons Jubilee could be a Rubyist's new best friend
6 reasons Jubilee could be a Rubyist's new best friend
6 reasons Jubilee could be a Rubyist's new best friend
6 reasons Jubilee could be a Rubyist's new best friend
Prochain SlideShare
Chargement dans…5
×

6 reasons Jubilee could be a Rubyist's new best friend

42 269 vues

Publié le

(Video here: http://confreaks.com/videos/5014-RubyConf2014-6-reasons-jubilee-could-be-a-rubyist-s-new-best-friend or https://www.youtube.com/watch?feature=player_embedded&v=FFR0G89WXI8)
Rubyconf 2014 talk on Jubilee, a Vert.x module that runs rack apps.

Alternate titles

Beyond Rails while using Rails

Rails can't do everything I want and <fill> makes me want to cry

Rubyconf abstract

Do you do web development in Ruby? Have you been forced to go to node or other technologies just for concurrency/websockets etc. Do miss your gems, and tire of functionality you have to implement from scratch? Do you hate javascript?

Well no need to switch languages/platforms, Jubilee could be your new best friend.

Jubilee, a rack server on top of Vert.x gives you

* Concurrency
* Speed
* Easy Websockets support
* Shared Memory
* Access to the JVM ecosystem
* Ability to reuse your existing Ruby knowledge and gems

"Say Hello to your new friend" - Al Pacino

Publié dans : Ingénierie, Logiciels
  • Nice !! Download 100 % Free Ebooks, PPts, Study Notes, Novels, etc @ https://www.ThesisScientist.com
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • Hello! Get Your Professional Job-Winning Resume Here - Check our website! https://vk.cc/818RFv
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • Hi there! Essay Help For Students | Discount 10% for your first order! - Check our website! https://vk.cc/80SakO
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici

6 reasons Jubilee could be a Rubyist's new best friend

  1. 6 REASONS JUBILEE COULD BE A RUBYIST’S NEW BEST FRIEND FORREST CHANG @FKCHANG2000 https://bambegin.files.wordpress.com/2014/09/tumblr_mfm9lq28cn1s14crlo1_500.jpg
  2. APOLOGIES http://images.sodahead.com/blogs/000302881/sorry20really20truly20very20apology_xlarge.jpeg .
  3. ALTERNATE TITLES AFTER SEEING ERNIE MILLER’S RUBY AFTER RAILS
  4. ! R A I L S W H I L E S T I L L USING RAILS
  5. OR
  6. RAILS CAN’T DO ALL THE STUFF I WANT ANYMORE AND <FILL IN THE TECH> MAKES ME WANT TO CRY http://www.louiseoneillauthor.com/wp-content/uploads/2014/06/crying-baby.jpg
  7. PRELUDE
  8. QUESTION http://wp.production.patheos.com/blogs/faithwalkers/files/2013/09/god-question.jpg
  9. WHY ARE YOU HERE AT RUBYCONF?
  10. AN ANSWER
  11. YOU LIKE RUBY
  12. WHY DO YOU LIKE RUBY?
  13. BECAUSE IT MAKES YOU HAPPY
  14. “For me the purpose of life is partly to have joy. Programmers often feel joy when they can concentrate on the creative side of programming, So Ruby is designed to make programmers happy.” –MATZ http://euruko.org/img/matz_800.jpg
  15. “For me the purpose of life is partly to have joy. Programmers often feel joy when they can concentrate on the creative side of programming, So Ruby is designed to make programmers happy.” –MATZ http://euruko.org/img/matz_800.jpg
  16. HAPPINESS IS THE RUBY WAY
  17. OBJECTIVE
  18. OBJECTIVE • To ensure you, the Rubyist, stays happy
  19. HAPPINESS IS A RECURRING THEME • J • D • D IN MY TALKS, AS WELL AS HERE AT RUBYCONF
  20. HAPPINESS IS A RECURRING THEME • J Joy • D • D IN MY TALKS, AS WELL AS HERE AT RUBYCONF
  21. HAPPINESS IS A RECURRING THEME • J Joy Driven • D • D IN MY TALKS, AS WELL AS HERE AT RUBYCONF
  22. HAPPINESS IS A RECURRING THEME • J Joy Driven Development • D • D IN MY TALKS, AS WELL AS HERE AT RUBYCONF
  23. CODING AND LOVING IT
  24. WHAT DO WE LIKE ABOUT RUBY?
  25. 1) LANGUAGE ITSELF IS DELIGHTFUL
  26. 1) LANGUAGE ITSELF IS DELIGHTFUL • An entire talk can be done on this
  27. 1) LANGUAGE ITSELF IS DELIGHTFUL • An entire talk can be done on this • So I won't do one
  28. SINGLE EXAMPLE FROM DEVISE CONFIG # ==> Configuration for :validatable! # Range for password length. Default is 8..128.! config.password_length = 8..128
  29. SINGLE EXAMPLE FROM DEVISE CONFIG # ==> Configuration for :validatable! # Range for password length. Default is 8..128.! config.password_length = 8..128 • Intent is so clear
  30. SINGLE EXAMPLE FROM DEVISE CONFIG # ==> Configuration for :validatable! # Range for password length. Default is 8..128.! config.password_length = 8..128 • Intent is so clear • Nothing extraneous
  31. SINGLE EXAMPLE FROM DEVISE CONFIG # ==> Configuration for :validatable! # Range for password length. Default is 8..128.! config.password_length = 8..128 • Intent is so clear • Nothing extraneous • Compared to new TimeRange(8, 128)
  32. SINGLE EXAMPLE FROM DEVISE CONFIG # ==> Configuration for :validatable! # Range for password length. Default is 8..128.! config.password_length = 8..128 • Intent is so clear • Nothing extraneous • Compared to new TimeRange(8, 128) • Beautiful
  33. RUBY MAKES ME HAPPY
  34. RUBY MAKES ME HAPPY
  35. 2) GEMS AND FRAMEWORKS
  36. 2) GEMS AND FRAMEWORKS • Many gems, nearly anything you'd want ready to go
  37. 2) GEMS AND FRAMEWORKS • Many gems, nearly anything you'd want ready to go • Choice, often more than 1 gem for the job
  38. 2) GEMS AND FRAMEWORKS • Many gems, nearly anything you'd want ready to go • Choice, often more than 1 gem for the job • Gem authors tend to emulate Matz and try to make the programmer happy
  39. 800lb Gorilla of Rubygems http://www.examiner.com/images/blog/wysiwyg/image/4056_Landing_gorilla-1.jpg
  40. RAILS
  41. RAILS • Who codes in Rails?
  42. RAILS • Who codes in Rails? • Who came to Ruby from Rails?
  43. RAILS • Who codes in Rails? • Who came to Ruby from Rails? • Who was coding Ruby before Rails?
  44. RAILS • Who codes in Rails? • Who came to Ruby from Rails? • Who was coding Ruby before Rails? • Who loves Rails?
  45. RAILS • Who codes in Rails? • Who came to Ruby from Rails? • Who was coding Ruby before Rails? • Who loves Rails? • Who has a job because of Rails?
  46. WHY WE LOVE RAILS
  47. WHY WE LOVE RAILS • A whole talk can be done this
  48. WHY WE LOVE RAILS • A whole talk can be done this • So I won't do one
  49. WHY WE LOVE RAILS • A whole talk can be done this • So I won't do one • Productivity
  50. WHY WE LOVE RAILS • A whole talk can be done this • So I won't do one • Productivity • Programmer interface - Omokase, designed to make the coder happy
  51. RAILS CAN MAKES YOU HAPPY
  52. RAILS CAN MAKES YOU HAPPY
  53. RUBY IS NOT A PANACEA
  54. SOME REASONS TO NOT USE RUBY
  55. SOME REASONS TO NOT USE RUBY • Speed
  56. SOME REASONS TO NOT USE RUBY • Speed • Image processing, video encoding
  57. SOME REASONS TO NOT USE RUBY • Speed • Image processing, video encoding • Scaling
  58. SOME REASONS TO NOT USE RUBY • Speed • Image processing, video encoding • Scaling • Resource heavy
  59. SOME REASONS TO NOT USE RUBY • Speed • Image processing, video encoding • Scaling • Resource heavy • Computation heavy
  60. SOME REASONS TO NOT USE RUBY • Speed • Image processing, video encoding • Scaling • Resource heavy • Computation heavy • More/better Library functionality elsewhere
  61. SOME REASONS TO NOT USE RUBY • Speed • Image processing, video encoding • Scaling • Resource heavy • Computation heavy • More/better Library functionality elsewhere • Scientific programming support better in Python, etc.
  62. ALL LEGIT REASONS
  63. PROBLEM
  64. PROBLEM Some non Ruby technologies can be “Less Happy Making”
  65. A COMMON ALTERNATIVE
  66. NODE, WHAT IT IS GOOD FOR?
  67. NODE, WHAT IT IS GOOD FOR?
  68. NODE, WHAT IT IS GOOD FOR? • Quick, Non blocking I/O
  69. NODE, WHAT IT IS GOOD FOR? • Quick, Non blocking I/O • Concurrency
  70. NODE, WHAT IT IS GOOD FOR? • Quick, Non blocking I/O • Concurrency • Chat app demonstrates Node’s sweet spot
  71. NODE, WHAT IT IS GOOD FOR? • Quick, Non blocking I/O • Concurrency • Chat app demonstrates Node’s sweet spot • high concurrency
  72. NODE, WHAT IT IS GOOD FOR? • Quick, Non blocking I/O • Concurrency • Chat app demonstrates Node’s sweet spot • high concurrency • quick, low CPU usage transactions
  73. NODE, WHAT IT IS GOOD FOR? • Quick, Non blocking I/O • Concurrency • Chat app demonstrates Node’s sweet spot • high concurrency • quick, low CPU usage transactions • server push
  74. NODE, WHAT IT IS GOOD FOR? • Quick, Non blocking I/O • Concurrency • Chat app demonstrates Node’s sweet spot • high concurrency • quick, low CPU usage transactions • server push • so called "modern webapp"
  75. WHAT IT NODE BAD AT?
  76. WHAT IT NODE BAD AT? • Vertical scaling
  77. WHAT IT NODE BAD AT? • Vertical scaling • CPU intensive
  78. WHAT IT NODE BAD AT? • Vertical scaling • CPU intensive • Integration with other systems
  79. WHAT IT NODE BAD AT? • Vertical scaling • CPU intensive • Integration with other systems • Decent language (Ruby bias)
  80. TOO MUCH JAVASCRIPT AND
  81. SO, HOW DO WE
  82. BRING BACK THAT LOVING FEELING?
  83. BRING BACK THAT LOVING FEELING?
  84. • Who's heard of it?
  85. • Who's heard of it? • Oversimplified - Node for the JVM
  86. • Who's heard of it? • Oversimplified - Node for the JVM • BUT much more - more like Node++ and then some
  87. DESIGNED FOR MODERN APPLICATIONS
  88. DESIGNED FOR MODERN APPLICATIONS
  89. DESIGNED FOR MODERN APPLICATIONS Ruby/ JRuby
  90. DESIGNED FOR MODERN APPLICATIONS Ruby/ JRuby
  91. DESIGNED FOR MODERN APPLICATIONS Ruby/ JRuby
  92. DESIGNED FOR MODERN APPLICATIONS Ruby/ JRuby
  93. SOME KEY FEATURES
  94. SOME KEY FEATURES
  95. SOME KEY FEATURES
  96. SOME KEY FEATURES
  97. SOME KEY FEATURES
  98. LIKE NODE
  99. LIKE NODE • Concurrency - Implements the same Reactor Pattern
  100. LIKE NODE • Concurrency - Implements the same Reactor Pattern • Non blocking i/o
  101. LIKE NODE • Concurrency - Implements the same Reactor Pattern • Non blocking i/o • Fast
  102. BETTER THAN NODE
  103. BETTER THAN NODE • Handles CPU intensive
  104. BETTER THAN NODE • Handles CPU intensive • JVM fast (JRuby fastes of the Rubies)
  105. BETTER THAN NODE • Handles CPU intensive • JVM fast (JRuby fastes of the Rubies) • JVM thread friendly
  106. BETTER THAN NODE • Handles CPU intensive • JVM fast (JRuby fastes of the Rubies) • JVM thread friendly • Handles Blocking IO or Long running operations
  107. BETTER THAN NODE • Handles CPU intensive • JVM fast (JRuby fastes of the Rubies) • JVM thread friendly • Handles Blocking IO or Long running operations • Worker verticles - uses threadpools
  108. BETTER THAN NODE • Handles CPU intensive • JVM fast (JRuby fastes of the Rubies) • JVM thread friendly • Handles Blocking IO or Long running operations • Worker verticles - uses threadpools • System scaling
  109. BETTER THAN NODE • Handles CPU intensive • JVM fast (JRuby fastes of the Rubies) • JVM thread friendly • Handles Blocking IO or Long running operations • Worker verticles - uses threadpools • System scaling • Horizontal scaling- Clustering
  110. BETTER THAN NODE • Handles CPU intensive • JVM fast (JRuby fastes of the Rubies) • JVM thread friendly • Handles Blocking IO or Long running operations • Worker verticles - uses threadpools • System scaling • Horizontal scaling- Clustering • Vertical scaling- Verticle per CPU
  111. BETTER THAN NODE, PART 2
  112. BETTER THAN NODE, PART 2 • Polyglot
  113. BETTER THAN NODE, PART 2 • Polyglot • Official idiomatic API support: Java, Javascript, Groovy, Coffeescript, *Ruby (by way of JRuby)*, Python
  114. BETTER THAN NODE, PART 2 • Polyglot • Official idiomatic API support: Java, Javascript, Groovy, Coffeescript, *Ruby (by way of JRuby)*, Python • Beta: Clojure, Scala, PhP (really?)
  115. BETTER THAN NODE, PART 2 • Polyglot • Official idiomatic API support: Java, Javascript, Groovy, Coffeescript, *Ruby (by way of JRuby)*, Python • Beta: Clojure, Scala, PhP (really?) • any JVM lang or one compiles to a JVM language
  116. BETTER THAN NODE, PART 2 • Polyglot • Official idiomatic API support: Java, Javascript, Groovy, Coffeescript, *Ruby (by way of JRuby)*, Python • Beta: Clojure, Scala, PhP (really?) • any JVM lang or one compiles to a JVM language • General Applications platform
  117. BETTER THAN NODE, PART 2 • Polyglot • Official idiomatic API support: Java, Javascript, Groovy, Coffeescript, *Ruby (by way of JRuby)*, Python • Beta: Clojure, Scala, PhP (really?) • any JVM lang or one compiles to a JVM language • General Applications platform • “modern web pages”
  118. BETTER THAN NODE, PART 2 • Polyglot • Official idiomatic API support: Java, Javascript, Groovy, Coffeescript, *Ruby (by way of JRuby)*, Python • Beta: Clojure, Scala, PhP (really?) • any JVM lang or one compiles to a JVM language • General Applications platform • “modern web pages” • traditional enterprise backends
  119. BETTER THAN NODE, PART 3
  120. BETTER THAN NODE, PART 3 • Designed to build systems of systems
  121. BETTER THAN NODE, PART 3 • Designed to build systems of systems • Easy High Availability
  122. BETTER THAN NODE, PART 3 • Designed to build systems of systems • Easy High Availability • Easy Clustering
  123. BETTER THAN NODE, PART 3 • Designed to build systems of systems • Easy High Availability • Easy Clustering • Easy subsystem Intercommunication
  124. BETTER THAN NODE, PART 3 • Designed to build systems of systems • Easy High Availability • Easy Clustering • Easy subsystem Intercommunication • Event Bus
  125. BETTER THAN NODE, PART 3 • Designed to build systems of systems • Easy High Availability • Easy Clustering • Easy subsystem Intercommunication • Event Bus • Shared Data
  126. CORE APIS- WHAT YOU NEED
  127. CORE APIS- WHAT YOU NEED • TCP/SSL clients and servers
  128. CORE APIS- WHAT YOU NEED • TCP/SSL clients and servers • HTTP/HTTPS clients and servers
  129. CORE APIS- WHAT YOU NEED • TCP/SSL clients and servers • HTTP/HTTPS clients and servers • Websockets
  130. CORE APIS- WHAT YOU NEED • TCP/SSL clients and servers • HTTP/HTTPS clients and servers • Websockets • SockJS
  131. CORE APIS- WHAT YOU NEED • TCP/SSL clients and servers • HTTP/HTTPS clients and servers • Websockets • SockJS • File system
  132. CORE APIS- WHAT YOU NEED • TCP/SSL clients and servers • HTTP/HTTPS clients and servers • Websockets • SockJS • File system • Event bus
  133. CORE APIS- WHAT YOU NEED • TCP/SSL clients and servers • HTTP/HTTPS clients and servers • Websockets • SockJS • File system • Event bus • DNS
  134. CORE APIS- WHAT YOU NEED • TCP/SSL clients and servers • HTTP/HTTPS clients and servers • Websockets • SockJS • File system • Event bus • DNS • UDP
  135. DUCT TAPE
  136. DUCT TAPE • Open SourceSystems are duct taped together
  137. DUCT TAPE • Open SourceSystems are duct taped together • We figure out how to do to put together things
  138. DUCT TAPE • Open SourceSystems are duct taped together • We figure out how to do to put together things • Perl used to be the duct tape of the internet, Ruby a cleaner Perl…
  139. DUCT TAPE • Open SourceSystems are duct taped together • We figure out how to do to put together things • Perl used to be the duct tape of the internet, Ruby a cleaner Perl… • Gems formalize that
  140. DUCT TAPE • Open SourceSystems are duct taped together • We figure out how to do to put together things • Perl used to be the duct tape of the internet, Ruby a cleaner Perl… • Gems formalize that • In Node, thats what you do even more
  141. VERT.X DESIGNED FOR INTEGRATED SYSTEMS
  142. DIFFERENT TYPES OF PROCESSES
  143. DIFFERENT TYPES OF PROCESSES • Asynchronous - Verticle
  144. DIFFERENT TYPES OF PROCESSES • Asynchronous - Verticle • Blocking/CPU intensive - worker verticle
  145. INTER PROCESS/SYSTEM COMMUNICATION
  146. INTER PROCESS/SYSTEM COMMUNICATION • Event Bus
  147. INTER PROCESS/SYSTEM COMMUNICATION • Event Bus • publish
  148. INTER PROCESS/SYSTEM COMMUNICATION • Event Bus • publish • direct message
  149. INTER PROCESS/SYSTEM COMMUNICATION • Event Bus • publish • direct message • direct message reply
  150. INTER PROCESS/SYSTEM COMMUNICATION • Event Bus • publish • direct message • direct message reply • extends into the browser
  151. INTER PROCESS/SYSTEM COMMUNICATION • Event Bus • publish • direct message • direct message reply • extends into the browser • Shared Data
  152. INTER PROCESS/SYSTEM COMMUNICATION • Event Bus • publish • direct message • direct message reply • extends into the browser • Shared Data • Hash
  153. INTER PROCESS/SYSTEM COMMUNICATION • Event Bus • publish • direct message • direct message reply • extends into the browser • Shared Data • Hash • Set
  154. SCALING BUILT I N
  155. SCALING BUILT I N • Clustering
  156. SCALING BUILT I N • Clustering • vertx process.rb —cluster
  157. SCALING BUILT I N • Clustering • vertx process.rb —cluster • High Availability
  158. SCALING BUILT I N • Clustering • vertx process.rb —cluster • High Availability • vertx process.rb —ha
  159. AND MUCH MORE
  160. AND MUCH MORE • A whole talk could be done on it
  161. AND MUCH MORE • A whole talk could be done on it • So I won’t do one
  162. AND MUCH MORE • A whole talk could be done on it • So I won’t do one • 2 Good overview videos
  163. AND MUCH MORE • A whole talk could be done on it • So I won’t do one • 2 Good overview videos • Tim Fox: Introducing Vert.x 2.0 - Taking Polyglot Application Development to the Next Level https://www.youtube.com/watch? v=3hv4QD5ZvKE
  164. AND MUCH MORE • A whole talk could be done on it • So I won’t do one • 2 Good overview videos • Tim Fox: Introducing Vert.x 2.0 - Taking Polyglot Application Development to the Next Level https://www.youtube.com/watch? v=3hv4QD5ZvKE • good over view of vert.x capabilities w/lots of live demos
  165. AND MUCH MORE • A whole talk could be done on it • So I won’t do one • 2 Good overview videos • Tim Fox: Introducing Vert.x 2.0 - Taking Polyglot Application Development to the Next Level https://www.youtube.com/watch? v=3hv4QD5ZvKE • good over view of vert.x capabilities w/lots of live demos • Vert.x: This ain't your Dad's Node. https://www.youtube.com/watch? v=8ClYUo_A3h0
  166. AND MUCH MORE • A whole talk could be done on it • So I won’t do one • 2 Good overview videos • Tim Fox: Introducing Vert.x 2.0 - Taking Polyglot Application Development to the Next Level https://www.youtube.com/watch? v=3hv4QD5ZvKE • good over view of vert.x capabilities w/lots of live demos • Vert.x: This ain't your Dad's Node. https://www.youtube.com/watch? v=8ClYUo_A3h0 • good at showing Vert.x's advantages over Node.js
  167. VERT. X I S P R E T T Y AWESOME
  168. VERT. X I S P R E T T Y AWESOME
  169. BUT IT’S MORE STUFF TO LEARN
  170. WHAT IF I TOLD YOU YOU COULD?
  171. ORIGINAL JUBILEE README SLOGAN
  172. ORIGINAL JUBILEE README SLOGAN "We need a web framework for Vertx.", you said.
  173. ORIGINAL JUBILEE README SLOGAN "We need a web framework for Vertx.", you said. "But why not use Vertx in your Rails applications, it's the most productive web framework ever created."
  174. JUBILEE
  175. JUBILEE • Originally Rack server w/ vert.x 2.0 built in
  176. JUBILEE • Originally Rack server w/ vert.x 2.0 built in • Now a Vert.x module that runs Rack
  177. JUBILEE • Originally Rack server w/ vert.x 2.0 built in • Now a Vert.x module that runs Rack • improved performance and interaction with the Vert.x ecosystem
  178. JUBILEE • Originally Rack server w/ vert.x 2.0 built in • Now a Vert.x module that runs Rack • improved performance and interaction with the Vert.x ecosystem • All the power of vert.x AND you can keep doing Ruby/Rack programming
  179. JUBILEE • Originally Rack server w/ vert.x 2.0 built in • Now a Vert.x module that runs Rack • improved performance and interaction with the Vert.x ecosystem • All the power of vert.x AND you can keep doing Ruby/Rack programming • Try that with Node!
  180. 6 REASONS VERT.X COULD BE YOUR NEW BEST FRIEND
  181. 6 REASONS VERT.X COULD BE YOUR NEW BEST FRIEND • Concurrency
  182. 6 REASONS VERT.X COULD BE YOUR NEW BEST FRIEND • Concurrency • Speed
  183. 6 REASONS VERT.X COULD BE YOUR NEW BEST FRIEND • Concurrency • Speed • Expanded Ecosystem
  184. 6 REASONS VERT.X COULD BE YOUR NEW BEST FRIEND • Concurrency • Speed • Expanded Ecosystem • Built in upgrade/scaling path
  185. 6 REASONS VERT.X COULD BE YOUR NEW BEST FRIEND • Concurrency • Speed • Expanded Ecosystem • Built in upgrade/scaling path • Easy web sockets support
  186. 6 REASONS VERT.X COULD BE YOUR NEW BEST FRIEND • Concurrency • Speed • Expanded Ecosystem • Built in upgrade/scaling path • Easy web sockets support • Reuse all your existing knowledge/resources
  187. 1) CONCURRENCY
  188. 1) CONCURRENCY • Same Reactor pattern as Node
  189. 1) CONCURRENCY • Same Reactor pattern as Node • Each Verticle single threaded
  190. 1) CONCURRENCY • Same Reactor pattern as Node • Each Verticle single threaded • Simple concurrency model, no threading
  191. 1) CONCURRENCY • Same Reactor pattern as Node • Each Verticle single threaded • Simple concurrency model, no threading • Multiple verticles, can do 1 per CPU
  192. 2) SPEED
  193. 2) SPEED • JVM faster and getting faster all the time
  194. 2) SPEED • JVM faster and getting faster all the time • Can use threads, cpus
  195. 2) SPEED • JVM faster and getting faster all the time • Can use threads, cpus • Benchmarks
  196. LIES, DAMN LIES, AND BENCHMARKS
  197. LIES, DAMN LIES, AND BENCHMARKS • http://vertxproject.wordpress.com/2012/05/09/vert-x-vs-node-js-simple-http-benchmarks/
  198. LIES, DAMN LIES, AND BENCHMARKS • http://vertxproject.wordpress.com/2012/05/09/vert-x-vs-node-js-simple-http-benchmarks/ Ruby
  199. LIES, DAMN LIES, AND BENCHMARKS • http://vertxproject.wordpress.com/2012/05/09/vert-x-vs-node-js-simple-http-benchmarks/ Ruby Node
  200. LIES, DAMN LIES, AND BENCHMARKS • http://vertxproject.wordpress.com/2012/05/09/vert-x-vs-node-js-simple-http-benchmarks/ Ruby Node 6 processes Node
  201. Ruby
  202. Ruby Best Node
  203. JUBILEE - 2ND FASTEST RUBY SERVER
  204. JUBILEE - 2ND FASTEST RUBY SERVER • http://www.madebymarket.com/blog/dev/ruby-web-benchmark- report.html
  205. JUBILEE - 2ND FASTEST RUBY SERVER • http://www.madebymarket.com/blog/dev/ruby-web-benchmark- report.html • Maximum speed benchmarks vs typical
  206. JUBILEE - 2ND FASTEST RUBY SERVER • http://www.madebymarket.com/blog/dev/ruby-web-benchmark- report.html • Maximum speed benchmarks vs typical • JRuby clear leader across the board
  207. JUBILEE - 2ND FASTEST RUBY SERVER • http://www.madebymarket.com/blog/dev/ruby-web-benchmark- report.html • Maximum speed benchmarks vs typical • JRuby clear leader across the board • Almost as fast as golang
  208. Golang hello world was 10,500 reqs/sec
  209. 3 ) E X PANDED ECOSYSTEM
  210. 3 ) E X PANDED ECOSYSTEM • Rubygems
  211. 3 ) E X PANDED ECOSYSTEM • Rubygems • Must run under JRuby
  212. 3 ) E X PANDED ECOSYSTEM • Rubygems • Must run under JRuby • Vertx modules (200 at time of writing)
  213. 3 ) E X PANDED ECOSYSTEM • Rubygems • Must run under JRuby • Vertx modules (200 at time of writing) • Entire JVM ecosystem, languages, libraries
  214. 3 ) E X PANDED ECOSYSTEM • Rubygems • Must run under JRuby • Vertx modules (200 at time of writing) • Entire JVM ecosystem, languages, libraries • Call other JVM languages directly from JRuby
  215. 3 ) E X PANDED ECOSYSTEM • Rubygems • Must run under JRuby • Vertx modules (200 at time of writing) • Entire JVM ecosystem, languages, libraries • Call other JVM languages directly from JRuby • Can run other JVM language verticles and communicate via Event Bus
  216. 4 ) BUILT IN UPGRADE/SCALING PATH
  217. 4 ) BUILT IN UPGRADE/SCALING PATH • Designed for multiple verticles (async)
  218. 4 ) BUILT IN UPGRADE/SCALING PATH • Designed for multiple verticles (async) • Worker verticles (slow)
  219. 4 ) BUILT IN UPGRADE/SCALING PATH • Designed for multiple verticles (async) • Worker verticles (slow) • Inter communication
  220. 4 ) BUILT IN UPGRADE/SCALING PATH • Designed for multiple verticles (async) • Worker verticles (slow) • Inter communication • Core APIs
  221. 4 ) BUILT IN UPGRADE/SCALING PATH • Designed for multiple verticles (async) • Worker verticles (slow) • Inter communication • Core APIs • Event Bus
  222. 4 ) BUILT IN UPGRADE/SCALING PATH • Designed for multiple verticles (async) • Worker verticles (slow) • Inter communication • Core APIs • Event Bus • Shared Data
  223. 4 ) BUILT IN UPGRADE/SCALING PATH • Designed for multiple verticles (async) • Worker verticles (slow) • Inter communication • Core APIs • Event Bus • Shared Data • Clustering
  224. 4 ) BUILT IN UPGRADE/SCALING PATH • Designed for multiple verticles (async) • Worker verticles (slow) • Inter communication • Core APIs • Event Bus • Shared Data • Clustering • High Availability
  225. 5) EASY WEBSOCKETS SUPPORT
  226. 5) EASY WEBSOCKETS SUPPORT • SocketIO support
  227. 5) EASY WEBSOCKETS SUPPORT • SocketIO support • SockJS support
  228. 5) EASY WEBSOCKETS SUPPORT • SocketIO support • SockJS support • ** Event Bus **
  229. 5) EASY WEBSOCKETS SUPPORT • SocketIO support • SockJS support • ** Event Bus ** • Easy
  230. 5) EASY WEBSOCKETS SUPPORT • SocketIO support • SockJS support • ** Event Bus ** • Easy • Extends into the browser
  231. 6 ) REUSE ALL YOUR EXISTING KNOWLEDGE/ RESOURCES
  232. 6 ) REUSE ALL YOUR EXISTING KNOWLEDGE/ RESOURCES • Ruby
  233. 6 ) REUSE ALL YOUR EXISTING KNOWLEDGE/ RESOURCES • Ruby • Rack programming
  234. 6 ) REUSE ALL YOUR EXISTING KNOWLEDGE/ RESOURCES • Ruby • Rack programming • i.e. Rails, Sinatra, etc.
  235. 6 ) REUSE ALL YOUR EXISTING KNOWLEDGE/ RESOURCES • Ruby • Rack programming • i.e. Rails, Sinatra, etc. • Gems
  236. 6 ) REUSE ALL YOUR EXISTING KNOWLEDGE/ RESOURCES • Ruby • Rack programming • i.e. Rails, Sinatra, etc. • Gems • Low barrier to entry for the Rubyist!
  237. JUBILEE CAN MAKE YOU HAPPY
  238. JUBILEE CAN MAKE YOU HAPPY
  239. INSTALLATION $ gem install jubilee!
  240. RUNNING WITH RACK $ cd a-jruby-compatible-rack-app! # Start it, several options available! $ jubilee <options> ! # If you don’t need jubilee options! $ rails s jubilee! $ rackup -s jubilee! # running as vertx module! $ vertx run config.ru -conf config.json !
  241. WHAT ABOUT HEROKU?
  242. WHAT ABOUT HEROKU? • http://funkworks.blogspot.com/2014/08/deploying-rails-41-app-served-by.html
  243. WHAT ABOUT HEROKU? • http://funkworks.blogspot.com/2014/08/deploying-rails-41-app-served-by.html Gemfile ruby '2.0.0', engine: 'jruby', engine_version: '1.7.13'! gem 'jubilee', :platforms => [:jruby]! gem 'rails_12factor'
  244. WHAT ABOUT HEROKU? • http://funkworks.blogspot.com/2014/08/deploying-rails-41-app-served-by.html Gemfile ruby '2.0.0', engine: 'jruby', engine_version: '1.7.13'! gem 'jubilee', :platforms => [:jruby]! gem 'rails_12factor' Procfile web: jubilee --eventbus /eventbus -n 1 —e $RACK_ENV -p $PORT !
  245. WHAT ABOUT HEROKU? • http://funkworks.blogspot.com/2014/08/deploying-rails-41-app-served-by.html Gemfile ruby '2.0.0', engine: 'jruby', engine_version: '1.7.13'! gem 'jubilee', :platforms => [:jruby]! gem 'rails_12factor' Procfile web: jubilee --eventbus /eventbus -n 1 —e $RACK_ENV -p $PORT ! Set JRuby/JVM Opts heroku config:add JRUBY_OPTS="-J-Xmn128m -J-Xms768m -J-Xmx768m"!
  246. GETTING THE MESSAGE ACROSS
  247. GETTING THE MESSAGE ACROSS • Everyone has slides
  248. GETTING THE MESSAGE ACROSS • Everyone has slides • Many have demos
  249. GETTING THE MESSAGE ACROSS • Everyone has slides • Many have demos • I want 1st hand interaction -
  250. AN EXPERIENCE
  251. AN EXPERIENCE
  252. NODE’S SWEET SPOT
  253. NODE’S SWEET SPOT • Chat - The sample app that everyone makes
  254. NODE’S SWEET SPOT • Chat - The sample app that everyone makes • How do I make a chat app a little more interesting?
  255. NODE’S SWEET SPOT • Chat - The sample app that everyone makes • How do I make a chat app a little more interesting? • How about a game with chat characterstics
  256. MMO WHAT?
  257. MMO WHAT? • Rock, Paper, Scissors
  258. MMO WHAT? • Rock, Paper, Scissors • Really!
  259. MMO WHAT? • Rock, Paper, Scissors • Really! • 4 kids, demanding job - World of Warcraft is out
  260. EXPERIENCING JUBILEE IN ACTION
  261. EXPERIENCING JUBILEE IN ACTION • Everyone in the room sign on
  262. EXPERIENCING JUBILEE IN ACTION • Everyone in the room sign on • Play each other
  263. EXPERIENCING JUBILEE IN ACTION • Everyone in the room sign on • Play each other • Have fun!
  264. EXPERIENCING JUBILEE IN ACTION • Everyone in the room sign on • Play each other • Have fun! • Then we talk
  265. EXPERIENCING JUBILEE IN ACTION • Everyone in the room sign on • Play each other • Have fun! • Then we talk • EXPERIMENT WARNING: Intentionally running in 1 dyno, curious to see how it scales
  266. EXPERIENCING JUBILEE IN ACTION • Everyone in the room sign on • Play each other • Have fun! • Then we talk • EXPERIMENT WARNING: Intentionally running in 1 dyno, curious to see how it scales • Conference WIFI
  267. EXPERIENCING JUBILEE IN ACTION • Everyone in the room sign on • Play each other • Have fun! • Then we talk • EXPERIMENT WARNING: Intentionally running in 1 dyno, curious to see how it scales • Conference WIFI • Sound effects file (bad decision?)
  268. ROCK R P PAPER S SCISSORS MAYHEM M
  269. R P S M
  270. ! P HTTP://BIT. LY/RPSMAYHEM ! ! ! ! M ! ! R S
  271. WHAT TO DO
  272. WHAT TO DO • Go to http://bit.ly/rpsmayhem
  273. WHAT TO DO • Go to http://bit.ly/rpsmayhem • Login with twitter
  274. WHAT TO DO • Go to http://bit.ly/rpsmayhem • Login with twitter • Android users click the “Play Sound” button to prime sound (HTML5 audio not quite there yet)
  275. WHAT TO DO • Go to http://bit.ly/rpsmayhem • Login with twitter • Android users click the “Play Sound” button to prime sound (HTML5 audio not quite there yet) • Likely to be the most taxing on conference wifi, (experiment)
  276. WHAT TO DO • Go to http://bit.ly/rpsmayhem • Login with twitter • Android users click the “Play Sound” button to prime sound (HTML5 audio not quite there yet) • Likely to be the most taxing on conference wifi, (experiment) • Pick opponents and play
  277. WHAT TO DO • Go to http://bit.ly/rpsmayhem • Login with twitter • Android users click the “Play Sound” button to prime sound (HTML5 audio not quite there yet) • Likely to be the most taxing on conference wifi, (experiment) • Pick opponents and play • Observe activity, player states
  278. WHAT TO DO • Go to http://bit.ly/rpsmayhem • Login with twitter • Android users click the “Play Sound” button to prime sound (HTML5 audio not quite there yet) • Likely to be the most taxing on conference wifi, (experiment) • Pick opponents and play • Observe activity, player states • If something’s off, refresh page, in progress matches will get rejoined
  279. PLAY I T !
  280. APP BREAKDOWN
  281. RIGHT TOOL FOR THE JOB
  282. RIGHT TOOL FOR THE JOB • Rails
  283. RIGHT TOOL FOR THE JOB • Rails • Login - omniauth, devise
  284. RIGHT TOOL FOR THE JOB • Rails • Login - omniauth, devise • Views - haml
  285. RIGHT TOOL FOR THE JOB • Rails • Login - omniauth, devise • Views - haml • DB - ActiveRecord, migrations
  286. RIGHT TOOL FOR THE JOB • Rails • Login - omniauth, devise • Views - haml • DB - ActiveRecord, migrations • Jubilee/Vert.x
  287. RIGHT TOOL FOR THE JOB • Rails • Login - omniauth, devise • Views - haml • DB - ActiveRecord, migrations • Jubilee/Vert.x • Event Bus - websockets, concurrency, subsystem communciation
  288. RIGHT TOOL FOR THE JOB • Rails • Login - omniauth, devise • Views - haml • DB - ActiveRecord, migrations • Jubilee/Vert.x • Event Bus - websockets, concurrency, subsystem communciation • Shared Data - quick shared memory
  289. RIGHT TOOL FOR THE JOB • Rails • Login - omniauth, devise • Views - haml • DB - ActiveRecord, migrations • Jubilee/Vert.x • Event Bus - websockets, concurrency, subsystem communciation • Shared Data - quick shared memory • Vertx::Timer - enforce challenge acceptance timeout
  290. RIGHT TOOL FOR THE JOB • Rails • Login - omniauth, devise • Views - haml • DB - ActiveRecord, migrations • Jubilee/Vert.x • Event Bus - websockets, concurrency, subsystem communciation • Shared Data - quick shared memory • Vertx::Timer - enforce challenge acceptance timeout • Additional Verticle - Bot
  291. RIGHT TOOL FOR THE JOB • Rails • Login - omniauth, devise • Views - haml • DB - ActiveRecord, migrations • Jubilee/Vert.x • Event Bus - websockets, concurrency, subsystem communciation • Shared Data - quick shared memory • Vertx::Timer - enforce challenge acceptance timeout • Additional Verticle - Bot • Worker Verticle - TBI Leaderboard
  292. APP SUMMARY
  293. APP SUMMARY • Rails to get to the game
  294. APP SUMMARY • Rails to get to the game • Jubilee/Vert.x to play the game
  295. SCREEN BY SCREEN
  296. MAIN PAGE
  297. MAIN PAGE Main page is vanilla Rails Sign in
  298. SIGN IN WITH TWITTER
  299. SIGN IN WITH TWITTER Omniauth gem makes it easy
  300. CHAT LIKE FEATURES OF THE GAME
  301. CHAT LIKE FEATURES OF THE GAME You
  302. CHAT LIKE FEATURES OF THE GAME You Live Activity Stream
  303. CHAT LIKE FEATURES OF THE GAME You Live Activity Stream Live presence and state
  304. CHALLENGE AN OPPONENT You can give up
  305. CHALLENGE TIME OUT Jubilee/Vert.x Timer checks and cancels the challenge
  306. REALTIME CHALLENGE
  307. REALTIME CHALLENGE Connected to server and each other by EventBus
  308. CHALLENGE TIME OUT
  309. CHALLENGE TIME OUT Jubilee/Vert.x Timer checks and cancels the challenge
  310. REALTIME MMO GAMEPLAY
  311. REALTIME MMO GAMEPLAY Connected to server and each other by EventBus, uses SharedData for speed
  312. REALTIME MMO GAMEPLAY Connected to server and each other by EventBus, uses SharedData for speed The bot is it’s own Verticle, playing via EventBus
  313. ARCHITECTURE IN 1 DYNO RAILS EVENT BOT BUS SVR SHARED DATA BROWSER CLIENT TIMERS
  314. ARCHITECTURE IN 1 DYNO Normal Rails App RAILS EVENT BOT BUS SVR SHARED DATA BROWSER CLIENT TIMERS
  315. ARCHITECTURE IN 1 DYNO Normal Rails App RAILS EVENT BOT BUS SVR SHARED DATA BROWSER CLIENT Rabbit MQ or similar TIMERS
  316. ARCHITECTURE IN 1 DYNO Normal Rails App RAILS EVENT BOT BUS SVR SHARED DATA BROWSER CLIENT TIMERS Server is EventBus handler, would be another process to handle concurrency Rabbit MQ or similar
  317. ARCHITECTURE IN 1 DYNO Normal Rails App RAILS EVENT BOT BUS Redis, Tokyo Cabinet, etc. Rabbit MQ or similar SVR SHARED DATA BROWSER CLIENT TIMERS Server is EventBus handler, would be another process to handle concurrency
  318. ARCHITECTURE IN 1 DYNO Normal Rails App RAILS EVENT BOT BUS Redis, Tokyo Cabinet, etc. Rabbit MQ or similar SVR SHARED DATA BROWSER CLIENT TIMERS Server is EventBus handler, would be another process to handle concurrency Websocket server/push
  319. ARCHITECTURE IN 1 DYNO Normal Rails App RAILS EVENT Bot Verticle would be another process BOT BUS Redis, Tokyo Cabinet, etc. Rabbit MQ or similar SVR SHARED DATA BROWSER CLIENT TIMERS Server is EventBus handler, would be another process to handle concurrency Websocket server/push
  320. ARCHITECTURE IN 1 DYNO Normal Rails App RAILS EVENT Bot Verticle would be another process BOT BUS Redis, Tokyo Cabinet, etc. Rabbit MQ or similar SVR SHARED DATA BROWSER CLIENT TIMERS Server is EventBus handler, would be another process to handle concurrency Websocket server/push Expire unanswered challenges Delayed job
  321. DESIGNED TO WORK TOGETHER
  322. AS OPPOSED TO DUCT TAPED TOGETHER
  323. DUCT TAPE
  324. APP CODE STATS
  325. APP CODE STATS • Client code 497 LOC Opal (including whitespace and debug)
  326. APP CODE STATS • Client code 497 LOC Opal (including whitespace and debug) • game.js.rb 444
  327. APP CODE STATS • Client code 497 LOC Opal (including whitespace and debug) • game.js.rb 444 • event_bus.rb 52
  328. APP CODE STATS • Client code 497 LOC Opal (including whitespace and debug) • game.js.rb 444 • event_bus.rb 52 • Server code: vertx initializer 50 LOC including whitespace and comments
  329. CODE
  330. CODE • Rails code - typical stuff you’re already doing - don’t need to see
  331. CODE • Rails code - typical stuff you’re already doing - don’t need to see • Client Game code - similar to what you might do browser side - don’t need to see
  332. CODE • Rails code - typical stuff you’re already doing - don’t need to see • Client Game code - similar to what you might do browser side - don’t need to see • Jubilee Code - you’ll want to see
  333. CODE • Rails code - typical stuff you’re already doing - don’t need to see • Client Game code - similar to what you might do browser side - don’t need to see • Jubilee Code - you’ll want to see • EventBus communication code - the heart of a Jubilee/Vert.x app
  334. CODE • Rails code - typical stuff you’re already doing - don’t need to see • Client Game code - similar to what you might do browser side - don’t need to see • Jubilee Code - you’ll want to see • EventBus communication code - the heart of a Jubilee/Vert.x app • Deploying another verticle, Bot, TBI Leaderboard
  335. CODE • Rails code - typical stuff you’re already doing - don’t need to see • Client Game code - similar to what you might do browser side - don’t need to see • Jubilee Code - you’ll want to see • EventBus communication code - the heart of a Jubilee/Vert.x app • Deploying another verticle, Bot, TBI Leaderboard • Shared Data
  336. CODE • Rails code - typical stuff you’re already doing - don’t need to see • Client Game code - similar to what you might do browser side - don’t need to see • Jubilee Code - you’ll want to see • EventBus communication code - the heart of a Jubilee/Vert.x app • Deploying another verticle, Bot, TBI Leaderboard • Shared Data • Timer
  337. EVENTBUS SETUP - RAILS begin! require 'vertx'! def to_array(shared_set)! ret = []! shared_set.each{ |item| ret << item}! ret! end! ! Vertx::EventBus.register_handler('logout') do |message|! user_id = message.body! puts "logging out #{user_id}"! Vertx::SharedData.get_set(:users).delete(user_id)! Vertx::EventBus.publish("user_logout", user_id)! end! ! # register the user and return the previous users! Vertx::EventBus.register_handler('login') do |message|! user_id = message.body! users = Vertx::SharedData.get_set(:users).add(user_id)! user_records = User.find(to_array(users)).to_json! message.reply(users: to_array(users))! user = User.find user_id! Vertx::EventBus.publish("new_user", user.to_json)! end! end
  338. EVENTBUS SETUP - RAILS begin! require 'vertx'! def to_array(shared_set)! ret = []! shared_set.each{ |item| ret << item}! ret! end! ! Vertx::EventBus.register_handler('logout') do |message|! user_id = message.body! puts "logging out #{user_id}"! Vertx::SharedData.get_set(:users).delete(user_id)! Vertx::EventBus.publish("user_logout", user_id)! end! ! # register the user and return the previous users! Vertx::EventBus.register_handler('login') do |message|! user_id = message.body! users = Vertx::SharedData.get_set(:users).add(user_id)! user_records = User.find(to_array(users)).to_json! message.reply(users: to_array(users))! user = User.find user_id! Vertx::EventBus.publish("new_user", user.to_json)! end! end
  339. EVENTBUS SETUP - RAILS begin! require 'vertx'! def to_array(shared_set)! ret = []! shared_set.each{ |item| ret << item}! ret! end! ! Vertx::EventBus.register_handler('logout') do |message|! user_id = message.body! puts "logging out #{user_id}"! Vertx::SharedData.get_set(:users).delete(user_id)! Vertx::EventBus.publish("user_logout", user_id)! end! ! # register the user and return the previous users! Vertx::EventBus.register_handler('login') do |message|! user_id = message.body! users = Vertx::SharedData.get_set(:users).add(user_id)! user_records = User.find(to_array(users)).to_json! message.reply(users: to_array(users))! user = User.find user_id! Vertx::EventBus.publish("new_user", user.to_json)! end! end
  340. EVENTBUS SETUP - RAILS begin! require 'vertx'! def to_array(shared_set)! ret = []! shared_set.each{ |item| ret << item}! ret! end! ! Vertx::EventBus.register_handler('logout') do |message|! user_id = message.body! puts "logging out #{user_id}"! Vertx::SharedData.get_set(:users).delete(user_id)! Vertx::EventBus.publish("user_logout", user_id)! end! ! # register the user and return the previous users! Vertx::EventBus.register_handler('login') do |message|! user_id = message.body! users = Vertx::SharedData.get_set(:users).add(user_id)! user_records = User.find(to_array(users)).to_json! message.reply(users: to_array(users))! user = User.find user_id! Vertx::EventBus.publish("new_user", user.to_json)! end! end
  341. EVENTBUS SETUP - RAILS begin! require 'vertx'! def to_array(shared_set)! ret = []! shared_set.each{ |item| ret << item}! ret! end! ! Vertx::EventBus.register_handler('logout') do |message|! user_id = message.body! puts "logging out #{user_id}"! Vertx::SharedData.get_set(:users).delete(user_id)! Vertx::EventBus.publish("user_logout", user_id)! end! ! # register the user and return the previous users! Vertx::EventBus.register_handler('login') do |message|! user_id = message.body! users = Vertx::SharedData.get_set(:users).add(user_id)! user_records = User.find(to_array(users)).to_json! message.reply(users: to_array(users))! user = User.find user_id! Vertx::EventBus.publish("new_user", user.to_json)! end! end
  342. EVENTBUS SETUP - RAILS begin! require 'vertx'! def to_array(shared_set)! ret = []! shared_set.each{ |item| ret << item}! ret! end! ! Vertx::EventBus.register_handler('logout') do |message|! user_id = message.body! puts "logging out #{user_id}"! Vertx::SharedData.get_set(:users).delete(user_id)! Vertx::EventBus.publish("user_logout", user_id)! end! ! # register the user and return the previous users! Vertx::EventBus.register_handler('login') do |message|! user_id = message.body! users = Vertx::SharedData.get_set(:users).add(user_id)! user_records = User.find(to_array(users)).to_json! message.reply(users: to_array(users))! user = User.find user_id! Vertx::EventBus.publish("new_user", user.to_json)! end! end
  343. SERVER CONTINUED begin! Vertx::EventBus.register_handler('game') do |message|! server = Server.new(Vertx::EventBus, Vertx)! cmd_hash = message.body["map"]! case cmd_hash["cmd"]! when "new_game"! server.new_game(cmd_hash["challenge_id"], cmd_hash["challenger_id"], cmd_hash["challenged_id"])! when "move"! server.move(cmd_hash["game_id"], cmd_hash["user_id"], cmd_hash["move"])! when "challenge_accepted"! server.challenge_accepted(cmd_hash["challenge_id"], cmd_hash["challenger_id"], cmd_hash["challenged_id"])! when "give_up_challenge"! server.give_up_challenge(cmd_hash["challenged_id"], cmd_hash["challenger_id"])! else! puts("Unhandled cmd: #{cmd_hash.inspect}")! end! end! Vertx.deploy_verticle("bot.rb")! rescue LoadError! puts "Vertx is NOT defined - no loading of vertx initializer"! end
  344. SERVER CONTINUED begin! Vertx::EventBus.register_handler('game') do |message|! server = Server.new(Vertx::EventBus, Vertx)! cmd_hash = message.body["map"]! case cmd_hash["cmd"]! when "new_game"! server.new_game(cmd_hash["challenge_id"], cmd_hash["challenger_id"], cmd_hash["challenged_id"])! when "move"! server.move(cmd_hash["game_id"], cmd_hash["user_id"], cmd_hash["move"])! when "challenge_accepted"! server.challenge_accepted(cmd_hash["challenge_id"], cmd_hash["challenger_id"], cmd_hash["challenged_id"])! when "give_up_challenge"! server.give_up_challenge(cmd_hash["challenged_id"], cmd_hash["challenger_id"])! else! puts("Unhandled cmd: #{cmd_hash.inspect}")! end! end! Vertx.deploy_verticle("bot.rb")! rescue LoadError! puts "Vertx is NOT defined - no loading of vertx initializer"! end
  345. SERVER CONTINUED begin! Vertx::EventBus.register_handler('game') do |message|! server = Server.new(Vertx::EventBus, Vertx)! cmd_hash = message.body["map"]! case cmd_hash["cmd"]! when "new_game"! server.new_game(cmd_hash["challenge_id"], cmd_hash["challenger_id"], cmd_hash["challenged_id"])! when "move"! server.move(cmd_hash["game_id"], cmd_hash["user_id"], cmd_hash["move"])! when "challenge_accepted"! server.challenge_accepted(cmd_hash["challenge_id"], cmd_hash["challenger_id"], cmd_hash["challenged_id"])! when "give_up_challenge"! server.give_up_challenge(cmd_hash["challenged_id"], cmd_hash["challenger_id"])! else! puts("Unhandled cmd: #{cmd_hash.inspect}")! end! end! Vertx.deploy_verticle("bot.rb")! rescue LoadError! puts "Vertx is NOT defined - no loading of vertx initializer"! end
  346. CLIENT SIDE EVENTBUS SETUP (OPAL) def setup_eventbus! @event_bus = EventBus.new! @event_bus.onopen {! @event_bus.send_msg(:login, @uid)! @event_bus.register_handler(:new_user) do |data|! json = JSON.parse(data)! @player_info[json[:id]] = { name: json[:name], image: json[:image]}! render_potential_victim(json) unless json[:id].to_i == @uid.to_i! append_activity("#{json['name']} joined")! end
  347. CLIENT SIDE EVENTBUS SETUP (OPAL) def setup_eventbus! @event_bus = EventBus.new! @event_bus.onopen {! @event_bus.send_msg(:login, @uid)! @event_bus.register_handler(:new_user) do |data|! json = JSON.parse(data)! @player_info[json[:id]] = { name: json[:name], image: json[:image]}! render_potential_victim(json) unless json[:id].to_i == @uid.to_i! append_activity("#{json['name']} joined")! end
  348. CLIENT SIDE EVENTBUS SETUP (OPAL) def setup_eventbus! @event_bus = EventBus.new! @event_bus.onopen {! @event_bus.send_msg(:login, @uid)! @event_bus.register_handler(:new_user) do |data|! json = JSON.parse(data)! @player_info[json[:id]] = { name: json[:name], image: json[:image]}! render_potential_victim(json) unless json[:id].to_i == @uid.to_i! append_activity("#{json['name']} joined")! end
  349. CLIENT SIDE EVENTBUS SETUP (OPAL) def setup_eventbus! @event_bus = EventBus.new! @event_bus.onopen {! @event_bus.send_msg(:login, @uid)! @event_bus.register_handler(:new_user) do |data|! json = JSON.parse(data)! @player_info[json[:id]] = { name: json[:name], image: json[:image]}! render_potential_victim(json) unless json[:id].to_i == @uid.to_i! append_activity("#{json['name']} joined")! end
  350. CLIENT CONTINUED @event_bus.register_handler(@uid) do |data|! cmd_hash = Native(data)! case cmd_hash["cmd"]! when "challenge"! show_challenge(cmd_hash)! when "new_game"! new_game(cmd_hash["challenger_id"], cmd_hash["challenged_id"], cmd_hash["game_id"])! when "move"! process_move(cmd_hash)! when "give_up_challenge"! give_up_challenge(cmd_hash)! when "challenge_aborted"! challenger_name = @player_info[cmd_hash["challenged_id"]][:name]! hide_overlay! swal("You missed a challenge from #{challenger_name}")! when "user_details"! json = @player_info[@uid].merge({id: @uid}).to_json! puts "Sending user_details #{json}"! replier.call(json)! when "not_available"! hide_overlay! swal "#{@player_info[@desired_challenged_id][:name]} is not available to play"! else! puts "can't handle "! end! end! end # split in half
  351. def cont! @event_bus.register_handler(:activity) do |data|! append_activity(data)! end! @event_bus.register_handler(:player_state) do |data|! `console.log(data); `! state_hash = Native(data)! set_player_states(state_hash)! end! @event_bus.register_handler(:user_logout) do |data|! user_id = data! puts "logging out #{user_id}"! append_activity("#{@player_info[user_id]['name']} left")! Element.find("##{user_id}").hide! end! }! end!
  352. BOT CODE @handler = Vertx::EventBus.register_handler(BOT_ID) do |message|! cmd_hash = message.body! puts "nBOT handling #{cmd_hash['cmd']}"! case cmd_hash["cmd"]! when "challenge"! Vertx::EventBus.send("game",! { cmd: "challenge_accepted",! challenge_id: cmd_hash["challenge_id"],! challenger_id: cmd_hash["challenger_id"],! challenged_id: BOT_ID! }! )! when "move"! process_move(cmd_hash)! when "give_up_challenge", "challenge_aborted", "not_available", "challenge_accepted"! # NO OP! else! puts "nBOT can't handle #{cmd_hash.inspect}"! p cmd_hash! end! ! end! ! def vertx_stop! puts "Must exterminate self!"! Vertx::EventBus.unregister_handler( BOT_ID, @handler)! end
  353. BOT CODE @handler = Vertx::EventBus.register_handler(BOT_ID) do |message|! cmd_hash = message.body! puts "nBOT handling #{cmd_hash['cmd']}"! case cmd_hash["cmd"]! when "challenge"! Vertx::EventBus.send("game",! { cmd: "challenge_accepted",! challenge_id: cmd_hash["challenge_id"],! challenger_id: cmd_hash["challenger_id"],! challenged_id: BOT_ID! }! )! when "move"! process_move(cmd_hash)! when "give_up_challenge", "challenge_aborted", "not_available", "challenge_accepted"! # NO OP! else! puts "nBOT can't handle #{cmd_hash.inspect}"! p cmd_hash! end! ! end! ! def vertx_stop! puts "Must exterminate self!"! Vertx::EventBus.unregister_handler( BOT_ID, @handler)! end
  354. BOT CODE @handler = Vertx::EventBus.register_handler(BOT_ID) do |message|! cmd_hash = message.body! puts "nBOT handling #{cmd_hash['cmd']}"! case cmd_hash["cmd"]! when "challenge"! Vertx::EventBus.send("game",! { cmd: "challenge_accepted",! challenge_id: cmd_hash["challenge_id"],! challenger_id: cmd_hash["challenger_id"],! challenged_id: BOT_ID! }! )! when "move"! process_move(cmd_hash)! when "give_up_challenge", "challenge_aborted", "not_available", "challenge_accepted"! # NO OP! else! puts "nBOT can't handle #{cmd_hash.inspect}"! p cmd_hash! end! ! end! ! def vertx_stop! puts "Must exterminate self!"! Vertx::EventBus.unregister_handler( BOT_ID, @handler)! end
  355. BOT CODE @handler = Vertx::EventBus.register_handler(BOT_ID) do |message|! cmd_hash = message.body! puts "nBOT handling #{cmd_hash['cmd']}"! case cmd_hash["cmd"]! when "challenge"! Vertx::EventBus.send("game",! { cmd: "challenge_accepted",! challenge_id: cmd_hash["challenge_id"],! challenger_id: cmd_hash["challenger_id"],! challenged_id: BOT_ID! }! )! when "move"! process_move(cmd_hash)! when "give_up_challenge", "challenge_aborted", "not_available", "challenge_accepted"! # NO OP! else! puts "nBOT can't handle #{cmd_hash.inspect}"! p cmd_hash! end! ! end! ! def vertx_stop! puts "Must exterminate self!"! Vertx::EventBus.unregister_handler( BOT_ID, @handler)! end
  356. SERVER TIMER CODE # timer when challenged! timer_id = @container.set_timer(10000) do |timer_id|! check_accepted?(challenge_id, challenger_id, challenged_id)! end! timer_map = Vertx::SharedData.get_hash(:timers)! timer_map[challenge_id] = timer_id! ! # clear the timer if user aborts his challenge! timer_map = Vertx::SharedData.get_hash(:timers)! timer_id = timer_map[challenge_id]! if timer_id! Vertx.cancel_timer timer_id! timer_map.delete challenge_id! end
  357. SERVER TIMER CODE # timer when challenged! timer_id = @container.set_timer(10000) do |timer_id|! check_accepted?(challenge_id, challenger_id, challenged_id)! end! timer_map = Vertx::SharedData.get_hash(:timers)! timer_map[challenge_id] = timer_id! ! # clear the timer if user aborts his challenge! timer_map = Vertx::SharedData.get_hash(:timers)! timer_id = timer_map[challenge_id]! if timer_id! Vertx.cancel_timer timer_id! timer_map.delete challenge_id! end
  358. SERVER TIMER CODE # timer when challenged! timer_id = @container.set_timer(10000) do |timer_id|! check_accepted?(challenge_id, challenger_id, challenged_id)! end! timer_map = Vertx::SharedData.get_hash(:timers)! timer_map[challenge_id] = timer_id! ! # clear the timer if user aborts his challenge! timer_map = Vertx::SharedData.get_hash(:timers)! timer_id = timer_map[challenge_id]! if timer_id! Vertx.cancel_timer timer_id! timer_map.delete challenge_id! end
  359. SERVER TIMER CODE # timer when challenged! timer_id = @container.set_timer(10000) do |timer_id|! check_accepted?(challenge_id, challenger_id, challenged_id)! end! timer_map = Vertx::SharedData.get_hash(:timers)! timer_map[challenge_id] = timer_id! ! # clear the timer if user aborts his challenge! timer_map = Vertx::SharedData.get_hash(:timers)! timer_id = timer_map[challenge_id]! if timer_id! Vertx.cancel_timer timer_id! timer_map.delete challenge_id! end
  360. SERVER TIMER CODE # timer when challenged! timer_id = @container.set_timer(10000) do |timer_id|! check_accepted?(challenge_id, challenger_id, challenged_id)! end! timer_map = Vertx::SharedData.get_hash(:timers)! timer_map[challenge_id] = timer_id! ! # clear the timer if user aborts his challenge! timer_map = Vertx::SharedData.get_hash(:timers)! timer_id = timer_map[challenge_id]! if timer_id! Vertx.cancel_timer timer_id! timer_map.delete challenge_id! end
  361. SERVER TIMER CODE # timer when challenged! timer_id = @container.set_timer(10000) do |timer_id|! check_accepted?(challenge_id, challenger_id, challenged_id)! end! timer_map = Vertx::SharedData.get_hash(:timers)! timer_map[challenge_id] = timer_id! ! # clear the timer if user aborts his challenge! timer_map = Vertx::SharedData.get_hash(:timers)! timer_id = timer_map[challenge_id]! if timer_id! Vertx.cancel_timer timer_id! timer_map.delete challenge_id! end
  362. JUBILEE CONSIDERATIONS IN RAILS
  363. JUBILEE CONSIDERATIONS IN RAILS • Setup server side EventBus in Rails initializer
  364. JUBILEE CONSIDERATIONS IN RAILS • Setup server side EventBus in Rails initializer • Done in initializer so it is done for whole Rails app
  365. JUBILEE CONSIDERATIONS IN RAILS • Setup server side EventBus in Rails initializer • Done in initializer so it is done for whole Rails app • Wrap vertx initialization in begin rescue so Rake tasks (not running vert.x server) will run
  366. DRAWBACKS
  367. DRAWBACKS • JRuby still 2nd class citizen, sometime have gem trouble or hard to get the config right
  368. DRAWBACKS • JRuby still 2nd class citizen, sometime have gem trouble or hard to get the config right • Debugging asynchronous multi agent systems still hard regardless
  369. DRAWBACKS • JRuby still 2nd class citizen, sometime have gem trouble or hard to get the config right • Debugging asynchronous multi agent systems still hard regardless • Fine control will require vertx style deploy instead of Rails friendly jubilee
  370. DRAWBACKS • JRuby still 2nd class citizen, sometime have gem trouble or hard to get the config right • Debugging asynchronous multi agent systems still hard regardless • Fine control will require vertx style deploy instead of Rails friendly jubilee • Error messages can get swallowed inside of Event Handlers
  371. DRAWBACKS • JRuby still 2nd class citizen, sometime have gem trouble or hard to get the config right • Debugging asynchronous multi agent systems still hard regardless • Fine control will require vertx style deploy instead of Rails friendly jubilee • Error messages can get swallowed inside of Event Handlers • Haven’t found the right place so that Jubilee/Vertx code auto reloads on Rails completely consistently
  372. ONE MORE THING
  373. ONE MORE THING • Opal (Ruby in the browser) front end == All Ruby Stack
  374. ONE MORE THING • Opal (Ruby in the browser) front end == All Ruby Stack • The same language on front end/back end advantage that Node touts is nice!
  375. ONE MORE THING • Opal (Ruby in the browser) front end == All Ruby Stack • The same language on front end/back end advantage that Node touts is nice! • This could be it’s own talk
  376. ONE MORE THING • Opal (Ruby in the browser) front end == All Ruby Stack • The same language on front end/back end advantage that Node touts is nice! • This could be it’s own talk • I already did that (RubyConf 2013 https://vimeo.com/ 82573680 ) So I won’t do it here
  377. RUBY IN THE BROWSER MAKES ME HAPPY
  378. RUBY IN THE BROWSER MAKES ME HAPPY
  379. THANKS • Matz - Ruby • DHH - Rails and jobs • Charles Nutter, Tom Enebo - JRuby • Tim Fox & Vert.x team - Vert.x • Isaiah Peng - Jubilee • Adam Beynon, Elia Schito, Meh’ - Opal • You for listening
  380. ADVICE TO RUBYISTS
  381. ADVICE TO RUBYISTS • Stay happy, you can still do most of your stuff in Ruby via Jubilee
  382. ADVICE TO RUBYISTS • Stay happy, you can still do most of your stuff in Ruby via Jubilee • Stay happy, you can grow/scale in Ruby via Jubilee
  383. ADVICE TO RUBYISTS • Stay happy, you can still do most of your stuff in Ruby via Jubilee • Stay happy, you can grow/scale in Ruby via Jubilee • Don’t worry, Be Happy

×