Advanced Eventmachine
summary
Uses EventMachine to parallelize millions of small S3 uploads and reports a measured 6x throughput gain by avoiding synchronous calls; warns that requiring non-evented gems or heavy per-iteration work (example: default AMQP client reading thousands of messages) blocks the reactor and halts processing. Recommends patterns: keep IO in the reactor, use EM.next_tick vs EM.defer to split short vs long work (defer uses a 20-thread pool), use deferrables, queues, channels, EM::Iterator and em-synchrony/fibers to make async code readable.
AI-written summary · about
chapters (15)
- 0:00Advanced EventMachine intro
- 3:06EventMachine at Scalarium
- 6:59Event loop explained
- 10:10Avoid blocking the loop
- 13:19next_tick and defer for concurrency
- 15:24Where code runs in EM
- 16:09Code with deferrables
- 23:12Queues and channels for coordination
- 26:28Parallel processing with EM::Iterator
- 29:14Callbacks with fibers
- 34:12EM with EM::Synchrony
- 35:37Goliath web apps
- 37:25Key takeaways
- 39:08Testing EventMachine applications
- 41:56Handling EM exceptions








