crystal-lang / crystal

The Crystal Programming Language
https://crystal-lang.org
Apache License 2.0
19.26k stars 1.61k forks source link

Add `EventLoop#run(blocking)` and `EventLoop#interrupt` #14568

Closed ysbaddaden closed 2 months ago

ysbaddaden commented 2 months ago

Implements a couple methods to run the event loop in non-blocking mode in addition to the blocking mode, plus the ability to interrupt a blocked thread. This adds the ability to:

These features aren't needed right now, but that will change with RFC 0002.

Both the libevent and IOCP implementations have been manually tested.

crysbot commented 2 months ago

This pull request has been mentioned on Crystal Forum. There might be relevant details there:

https://forum.crystal-lang.org/t/curious-about-the-eventloop-updates/6825/1