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

Abstract Crystal::Scheduler methods #14555

Conversation

ysbaddaden
Copy link
Contributor

Changes are internal (private), except for Fiber.suspend that introduces a new public method.

  • Add Crystal::EventLoop.current instead of Crystal::Scheduler.event_loop
  • Use Fiber#enqueue instead of Crystal::Scheduler.enqueue
  • Add Fiber.suspend instead of Crystal::Scheduler.reschedule
    • alternative: it could be Fiber.reschedule

This is part 2 of abstracting Crystal::Scheduler away.

@straight-shoota
Copy link
Member

I believe these commits should be individual PRs. Especially considering that some are just internal refactoring while one adds a new feature.

@ysbaddaden
Copy link
Contributor Author

@ysbaddaden ysbaddaden closed this May 3, 2024
@ysbaddaden ysbaddaden deleted the refactor/abstract-crystal-scheduler-methods branch May 3, 2024 17:11
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