Ruby developers need to stop using EventMachine. It's the wrong direction.
Lost in the "Threads vs Event Driven vs Process Spawning" debate is that you can combine them! Learn how Celluloid is improving thread programming by abstracting them using a higher level framework called Celluloid, how you can use Celluloid::IO to throw a reactor pattern into a thread. Using this approach, you can take advantage of threading and use all CPU power on a machine with JRuby or Rubinius. I also discuss the future of distributed objects and computing, and where I think things are going.
9. EventMachine is
• A frankenstein - guts the ruby internals
• Not in active development
Text
• Makes non-blocking IO block
• Requires special code from Ruby libraries
• Hard to use in an OOP way
• Is really difficult to work with
• Poorly documented
31. “..seasoned engineers are
using a mix of threaded,
event-based, and
alternative concurrency
approaches like Actors”
- Alex Payne
32. What if we could
combine threads
and reactor
patterns.. and
actors?!
33. https://github.com/celluloid/celluloid-io
• One reactor pattern per Celluloid object
• Multiple reactors? No problem!
• Doesn’t mess with code outside of actor
• Utilizes all CPU cores (using JRuby and Rubinius)
• Websockets, messaging systems, your hugely
successful blog
34. You don't have to
choose between
threaded and
evented IO!
36. "I thought of objects being like
biological cells and/or
individual computers on a
network, only able to
communicate with messages"
- Alan Kay
37. Guess who was really
into distributed
network objects?
38.
39. NeXT experimented
with distributed
objects in the mid 90s.
NeXT was way ahead
of its time.
40. "Objects can message objects transparently
that live on other machines over the network,
and you don't have to worry about the
networking gunk, and you don't have to worry
about finding them, and you don't have to
worry about anything. It's just as if you
messaged an object that's right next door."
- Steve Jobs
42. https://github.com/celluloid/dcell
• Objects talk over networks!
• Uses 0MQ
• Aware of eachothers’ existence
• Distributed gossip protocol
• Web UI
• In the early stages, very promising