EventMachine

7,803 views
7,680 views

Published on

Brief introduction into EventMachine by Jonathan Weiss presented at RailsCamp 4 in Cologne (03.07.2010)

Published in: Technology, Education
0 Comments
14 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
7,803
On SlideShare
0
From Embeds
0
Number of Embeds
133
Actions
Shares
0
Downloads
70
Comments
0
Likes
14
Embeds 0
No embeds

No notes for slide

EventMachine

  1. 1. EventMachine Yes, that’s NodeJS in Ruby Jonathan Weiss 02.07.2010
  2. 2. EventMachine „Event-driven I/O using the reactor pattern“ http://rubyeventmachine.com/ 2
  3. 3. Goals Scalable and performant but low-level I/O library API that removes threaded complexety 3
  4. 4. Install $ sudo gem install eventmachine Works with Ruby, Rubinius, and JRuby 4
  5. 5. Use EventMachine $ sudo gem install eventmachine Works with Ruby, Rubinius, and JRuby 5
  6. 6. Echo Server $ sudo gem install eventmachine Works with Ruby, Rubinius, and JRuby 6
  7. 7. Low Level HTTP Client $ sudo gem install eventmachine Works with Ruby, Rubinius, and JRuby 7
  8. 8. EM::HttpRequest $ sudo gem install eventmachine Works with Ruby, Rubinius, and JRuby 8
  9. 9. Simple Timer $ sudo gem install eventmachine Works with Ruby, Rubinius, and JRuby 9
  10. 10. Simple Timer $ sudo gem install eventmachine Works with Ruby, Rubinius, and JRuby 10
  11. 11. Protocol Support TCP (+ SSL) FileWatcher HTTP(s) / WebSocket Timer Memcached PeriodicTimer SASLauth ProcessWatch Postgres3 SpawnedProcess SMTP Queue Sock4 Stomp 11
  12. 12. Higher Level APIs on top AMQP Nanite MySQL DNS Redis MongoDB HTTPRequest WebSocket Amazon S3 12
  13. 13. Happening: S3 + EventMachine $ sudo gem install eventmachine Works with Ruby, Rubinius, and JRuby 13
  14. 14. Why you want async: Uploading 100 x 2 MB files: RightAWS vs. Happening 10min vs. 5:40min 14
  15. 15. EventMachine vs. NodeJS EventMachine NodeJS Engine Ruby V8 Available Libraries All Ruby libs, gems, … Only NodeJS libs Possibility to block YES NO Coding Style Callbacks, Callbacks Procedural with fibers 15
  16. 16. EM::Synchrony – 1.9 Fibers $ sudo gem install eventmachine Works with Ruby, Rubinius, and JRuby 16
  17. 17. Q&A Peritor GmbH Blücherstr. 22, Hof III Aufgang 6 10961 Berlin Tel.: +49 (0)30 69 20 09 84 0 Fax: +49 (0)30 69 20 09 84 9 Internet: www.peritor.com E-Mail: info@peritor.com © Peritor GmbH - Alle Rechte vorbehalten

×