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

Add Fiber.suspend #14560

Merged

Conversation

ysbaddaden
Copy link
Contributor

@ysbaddaden ysbaddaden commented May 3, 2024

Replaces the private Crystal::Scheduler.reschedule method that suspends the execution of the current fiber (that must be manually re-enqueued to be resumed) with a public method: Fiber.suspend.

Note

It could be Fiber.reschedule. I'm not sure which term is more explicit and closer to the intent?

Related to the other PRs that abstract Crystal::Scheduler away.

Relates to: #5204

@straight-shoota
Copy link
Member

I think suspend fits better than reschedule. The latter works in the context of Scheduler, but we're not rescheduling the fiber, we're suspending it.

src/fiber.cr Outdated Show resolved Hide resolved
@straight-shoota straight-shoota added this to the 1.13.0 milestone May 6, 2024
@straight-shoota straight-shoota changed the title Add Fiber.suspend Add Fiber.suspend May 6, 2024
@straight-shoota straight-shoota merged commit a23f0fb into crystal-lang:master May 7, 2024
60 checks passed
@ysbaddaden ysbaddaden deleted the feature/add-fiber-suspend branch May 7, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants