hiredis-rb icon indicating copy to clipboard operation
hiredis-rb copied to clipboard

This is probably not compatible with Ruby 3.0's Fiber Scheduler?

Open machty opened this issue 3 years ago • 1 comments

Ruby 3.0 introduced the FiberScheduler interface so that evented libraries like Async can hook into low-level blocking IO events and use them to efficiently schedule/coordinate concurrent Fiber-driven tasks behind the scenes.

I've been playing around with Ruby 3.1 + async Fiber-driven tasks + hiredis-rb, and I believe, as it stands, blocking operations like blpop are going to block the entire Reactor because hiredis isn't aware of the Fiber Scheduler.

It is possible for native C extension to be FiberScheduler-aware, see:

https://www.wjwh.eu/posts/2020-12-28-ruby-fiber-scheduler-c-extension.html#integrating-the-fiber-scheduler-into-c-extensions

But I'm just wondering, would it be possible to make hiredis-rb be FiberScheduler-aware? Or are all the hookpoints too embedded within hiredis to make that work?

machty avatar Jan 09 '22 15:01 machty

any news on this? Is this something that is gonna be a problem upgrading?

@machty have someone told you anything about your concerns?

patrickemuller avatar May 16 '23 20:05 patrickemuller