Hybrid concurrency patterns

4 min read Original article ↗

More Related Content

Ruby is dying. What languages are cool now?

Fast, concurrent ruby web applications with EventMachine and EM::Synchrony

The Actor Model - Towards Better Concurrency

Actor Patterns and NATS - Boulder Meetup

Bringing Concurrency to Ruby - RubyConf India 2014

Model with actors and implement with Akka

What's hot

JRuby: Pushing the Java Platform Further

Culerity - Headless full stack testing for JavaScript

Ruby in office time reboot

Clojure Conj 2014 - Paradigms of core.async - Julian Gamble

Applying the paradigms of core.async in Clojure and ClojureScript

Functional Programming in Clojure

Rubykaigi 2017-nishimotz-v6

Actor model : A Different Concurrency Approach

Building GUI App with Electron and Lisp

Kevin Whinnery: Write Better JavaScript

Ruby projects of interest for DevOps

Similar to Hybrid concurrency patterns

Concurrent Programming with Ruby and Tuple Spaces

Concurrency patterns in Ruby

Concurrency patterns in Ruby

Ruby Concurrency Realities

Concurrent programming with Celluloid (MWRC 2012)

Ruby's Concurrency Management: Now and Future

Don’t block the event loop!

Celluloid - Beyond Sidekiq

Ruby Performance - The Last Mile - RubyConf India 2016

TorqueBox at DC:JBUG - November 2011

Servers with Event Machine - David Troy - RailsConf 2011

Recently uploaded

Goddess Feb News by YogiGoddess of LDMMIA

Festeve'26 Quiz: Finals, Women's Christian College, Chennai

Review of Influencers Gone Wild: AI Social Interaction and Companionship App

BASIC_SUBSURFACE_FLOW hydrology_water_pdf

IPTVGREAT 2026: Ultimate IPTV Service with 140K+ Channels & 4K Streaming

Buy Verified Airbnb Account_ What You Must Know Before .docx

BBC NW_Tech Facilities_30 Odd Yrs Ago [J][IV].pdf

Purchase Secure Verified PayPal Accounts.pdf

GoFest – your hub for festival essentials

Hybrid concurrency patterns

  • 1.

    Threads and Events in Harmony with Celluloid Kyle Drake

  • 2.

    Hi, I’m KyleDrake. I work at Geoloqi Esri. We built a geofencing Text and real-time location streaming platform.

  • 3.
  • 4.

    I was reallyinto pure event-driven Text (reactor pattern based) architecture.

  • 5.

    EventMachine, Twisted, Node.js • Event-driven Text • No threads • One CPU core • Process Spawning

  • 6.
  • 7.
  • 8.
  • 9.

    EventMachine is • Afrankenstein - 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

  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 18.

    Ruby MRI: Global InterpreterLock (single CPU core) Rubinius and JRuby: Full threading (multiple CPU cores) ~20KB per thread

  • 19.
  • 20.
  • 21.
  • 22.

    Let’s fix itby abstracting threads into how humans think!

  • 24.
  • 25.

    Each actor isa concurrent object running in its own thread

  • 28.
  • 30.
  • 31.

    “..seasoned engineers are usinga mix of threaded, event-based, and alternative concurrency approaches like Actors” - Alex Payne

  • 32.

    What if wecould combine threads and reactor patterns.. and actors?!

  • 33.

    https://github.com/celluloid/celluloid-io • One reactorpattern 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.
  • 35.
  • 36.

    "I thought ofobjects being like biological cells and/or individual computers on a network, only able to communicate with messages" - Alan Kay

  • 37.

    Guess who wasreally into distributed network objects?

  • 39.

    NeXT experimented with distributed objects in the mid 90s. NeXT was way ahead of its time.

  • 40.

    "Objects can messageobjects 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

  • 41.
  • 42.

    https://github.com/celluloid/dcell • Objectstalk over networks! • Uses 0MQ • Aware of eachothers’ existence • Distributed gossip protocol • Web UI • In the early stages, very promising

  • 43.
  • 44.
  • 45.

Editor's Notes