Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
machty opened this issue Jan 9, 2022 · 1 comment · May be fixed by #77
Open

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

machty opened this issue Jan 9, 2022 · 1 comment · May be fixed by #77

Comments

@machty
Copy link

machty commented Jan 9, 2022

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 machty changed the title This is probably not compatible with Ruby 3.0 This is probably not compatible with Ruby 3.0's Fiber Schedule Jan 9, 2022
@machty machty changed the title This is probably not compatible with Ruby 3.0's Fiber Schedule This is probably not compatible with Ruby 3.0's Fiber Scheduler? Jan 9, 2022
@machty machty linked a pull request Jan 13, 2022 that will close this issue
1 task
@patrickemuller
Copy link

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

@machty have someone told you anything about your concerns?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants