EventMachine
summary
EventMachine is a Ruby reactor that handles 5–10k concurrent connections in one process by doing nonblocking IO and buffering, with a C++ reactor with epoll/kqueue and a JRuby Java reactor alternative; it exposes timers, deferreds, queues, em.defer thread pools and an object protocol that handles marshalling so handlers get Ruby objects not streams. The demo is a 130-line chat server that pipelines Twitter streaming, invokes subprocesses via em.system, and runs without blocking the reactor, though live demo depends on network.
AI-written summary · about
chapters (19)
- 0:00Start
- 4:13Tcp Server
- 7:32Reactor Loop
- 9:20Reactor Events Are Handled Asynchronously
- 11:45The Problem with Events
- 16:25Synchronous Loop
- 17:58Comparing Contrasting Synchronous Code versus Asynchronous Code
- 19:31Threading
- 20:22Timers
- 20:37Single One-Shot Timers
- 21:29Callback
- 22:10Iam Deferrable
- 27:14Networking
- 31:00Buffered Tokenizer
- 31:39Object Protocol
- 32:56Websocket
- 35:36Sync Sinatra
- 36:28Chat Server
- 37:20Twitter Streaming Api








