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...
5. Your code
• Called by reactor
• blocking ! (called
by a single thread
dispatcher aka
reactor)
6. Your code
• each timer own a
callback, like any
code like network
call etc....
• a long running
task will block the
reactor
7. Tread pool
• Pool fixed size !
• Dont block the
reactor if you
have a long
running task
• use the thread
pool !
8. Tread pool
• EM.defer -> run
the callback inside
on thread on the
pool thread
• Reactor continue
to dispatch to
other code. nice !
9. simple server
• module implements
callbacks: easy !
• see the
EventMachine.run
-> launch the
reactor
• Inside reactor ->
start server :)
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 :)