Enumberable's Ugly Cousin
summary
Explains that Enumerator wraps method calls and can be reimplemented to_enum with Fiber to provide external iteration like next, demonstrates turning Ruby methods into generator-like enumerators for paginated APIs and web crawlers, shows how to produce infinite sequences and use the built-in lazy enumerator pipeline to avoid eager evaluation, and describes building montrose, a recurrence gem that yields recurring timestamps on demand and works in production for generating endless event sequences without blowing memory.
AI-written summary · about
chapters (8)
- 0:00Start
- 7:56Replace Nested Loop
- 20:22Recap
- 23:08Binary Tree
- 24:15Infinite Sequences
- 24:50Iterate Function
- 26:41Eager and Lazy
- 27:34Recurrence Recurring Events
related talks
11mEnumerable's Ugly Cousin
45mEnumerable for Fun & Profit
33mThe Enumerable Module or How I fell in Love with Ruby
27mEach All the Way Down: How Ruby Enumerators Power Streaming...
29mTeaching Ruby to Count
31mEach: A Brief History of Iteration
30mFlattening Recursion with Fibers
43mFunctional Programming and Ruby
