Ruby eventmachine pres at rubybdx
Upcoming SlideShare
Loading in...5
×
 

Ruby eventmachine pres at rubybdx

on

  • 1,118 views

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

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...

Statistics

Views

Total Views
1,118
Views on SlideShare
985
Embed Views
133

Actions

Likes
2
Downloads
1
Comments
0

3 Embeds 133

http://www.mathieu-elie.net 129
http://www.linkedin.com 3
http://feeds.feedburner.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Ruby eventmachine pres at rubybdx Ruby eventmachine pres at rubybdx Presentation Transcript

  • 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 forever ;)
  • 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 reactor
  • 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 code. nice !
  • simple server• module implements callbacks: easy !• see the EventMachine.run -> launch the reactor• Inside reactor -> start server :)
  • 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 :)