RubyConf 2024 Flattening Recursion with Fibers by Jamis Buck & Adviti Mishra
Channel:
Subscribers:
42,400
Published on ● Video Link: https://www.youtube.com/watch?v=TyRQ97VVpu8
We used Ruby's fibers at MongoDB to unwind a recursive algorithm and execute it horizontally, without the stack overhead of recursion.
"Hang on," you might be thinking. "I thought fibers were a concurrency primitive?"
You're not wrong!
In this presentation, we'll summarize the problem we encountered while working with recursive callbacks, and give an overview of fibers in Ruby. Then, we'll put the two together and show you exactly how we ended up using fibers to solve an issue that was completely unrelated to concurrency.