Skip to content

Fix min_by? in IOCP event loop #run_once#14394

Merged
straight-shoota merged 1 commit intocrystal-lang:masterfrom
straight-shoota:fix/iocp-event-loop-min_by
Mar 26, 2024
Merged

Fix min_by? in IOCP event loop #run_once#14394
straight-shoota merged 1 commit intocrystal-lang:masterfrom
straight-shoota:fix/iocp-event-loop-min_by

Conversation

@straight-shoota
Copy link
Member

min_by raises if the queue is empty but we want to handle this case explicitly in the following condition.

This is practically not very relevant as the queue should never be empty in normal operation. But it might be useful when working on the event loop itself.

`min_by` raises if the queue is empty but we want to handle this case
explicitly in the following condition.
@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:runtime labels Mar 25, 2024
@straight-shoota straight-shoota self-assigned this Mar 25, 2024
@straight-shoota straight-shoota added this to the 1.12.0 milestone Mar 25, 2024
@ysbaddaden
Copy link
Collaborator

The current Crystal::Scheduler happen to always have an event in the event loop, but that may not be true in the future anymore (e.g. RFC #2).

@straight-shoota straight-shoota merged commit d2cf45e into crystal-lang:master Mar 26, 2024
@straight-shoota straight-shoota deleted the fix/iocp-event-loop-min_by branch March 26, 2024 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:runtime

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants