Your SlideShare is downloading. ×
0
EVENTMACHINEfast, simple event-processing library for Ruby programs
EventMachine        Components• Reactor• Your code  (callbacks)• Tread pool (non  blocking long  running tasks)
Reactor• Main loop /  Central point• Dispatch call to  business code  (your code)• Single threaded !
Reactor• run-reactor.rb• EM.run block until   its stopped• its not really  blocking, the  reactor pattern is  running fore...
Your code• Called by reactor• blocking ! (called  by a single thread  dispatcher aka  reactor)
Your code• each timer own a  callback, like any  code like network  call etc....• a long running  task will block the  rea...
Tread pool• Pool fixed size !• Dont block the  reactor if you  have a long  running task• use the thread  pool !
Tread pool• EM.defer -> run  the callback inside  on thread on the  pool thread• Reactor continue  to dispatch to  other c...
simple server• module implements  callbacks: easy !• see the  EventMachine.run  -> launch the  reactor• Inside reactor -> ...
contact / more infos• http://www.mathieu-elie.net -> tech blog ->  and all concact infos (github, linkedin, and  so on...)...
Upcoming SlideShare
Loading in...5
×

Ruby eventmachine pres at rubybdx

767

Published on

More infos on http://www.mathieu-elie.net/eventmachine-introduction-pres-rubybdx-screencast-fr

Ruby Eventmachine is a really goop option to build scalable real time servers and more...

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

No Downloads
Views
Total Views
767
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
1
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "Ruby eventmachine pres at rubybdx"

  1. 1. EVENTMACHINEfast, simple event-processing library for Ruby programs
  2. 2. EventMachine Components• Reactor• Your code (callbacks)• Tread pool (non blocking long running tasks)
  3. 3. Reactor• Main loop / Central point• Dispatch call to business code (your code)• Single threaded !
  4. 4. Reactor• run-reactor.rb• EM.run block until its stopped• its not really blocking, the reactor pattern is running forever ;)
  5. 5. Your code• Called by reactor• blocking ! (called by a single thread dispatcher aka reactor)
  6. 6. Your code• each timer own a callback, like any code like network call etc....• a long running task will block the reactor
  7. 7. Tread pool• Pool fixed size !• Dont block the reactor if you have a long running task• use the thread pool !
  8. 8. Tread pool• EM.defer -> run the callback inside on thread on the pool thread• Reactor continue to dispatch to other code. nice !
  9. 9. simple server• module implements callbacks: easy !• see the EventMachine.run -> launch the reactor• Inside reactor -> start server :)
  10. 10. contact / more infos• http://www.mathieu-elie.net -> tech blog -> and all concact infos (github, linkedin, and so on...)• available for freelance• questions ? feel free to mail me :)
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×