Ruby 3 adds Scheduler Interface for Fibers

Ruby adds Fiber SchedulerInterface to support non-blocking fiber. Splitting long operations into fiber hooks and Scheduler will manage it for us.

An Introduction to Ruby's 'Fibers'

Image Source: https://bit.ly/3983OrCWhat are fibers? Fibers are workers, they run code & keep track of their progress. They are a concurrency mechanism like threads but are contrasting in nature when compared with threads. The control flow of a thread can get interrupted at any time and another thread can take over. With fiber, the control only switches when we explicitly tell it to. In this article, we will dive deeper to understand this difference and how to implement Fibers. First things first, the difference between #fibers and #threads Fibers are light-weight and they eat much less memory