socketry / async

An awesome asynchronous event-driven reactor for Ruby.
MIT License
2.15k stars 89 forks source link

Graceful shutdown #337

Closed ioquatix closed 3 months ago

ioquatix commented 3 months ago

This expands on the current revised implementation in order to allow transient tasks to gracefully shutdown without being forcefully terminated.

On stopping a transient task, it is converted to a non-transient task, which prevents the event loop from exiting. This keeps the event loop alive.

If a task creates new tasks while it's finishing, those will be handled according to the existing logic.

Types of Changes

Contribution