-
Notifications
You must be signed in to change notification settings - Fork 0
Supervised tasks RFC #34
Copy link
Copy link
Open
Labels
asyncAsync, concurrency, channels, tasksAsync, concurrency, channels, tasksfeatureNew language feature or capabilityNew language feature or capabilityrfcTied to a specific RFC or design docTied to a specific RFC or design doc
Description
Metadata
Metadata
Assignees
Labels
asyncAsync, concurrency, channels, tasksAsync, concurrency, channels, tasksfeatureNew language feature or capabilityNew language feature or capabilityrfcTied to a specific RFC or design docTied to a specific RFC or design doc
What problem does this solve?
If an async task crashes, it just dies. There's no automatic restart, no backoff, no supervision. For long-running services you need tasks that can recover from failures without bringing down the whole program.
Proposed solution
Supervisor trees, inspired by Erlang/OTP. The RFC covers:
All the core decisions are open. This is a draft RFC that needs a lot of design work before implementation starts.
Alternatives considered
Could leave error recovery to userland code (wrap everything in retry loops). That works but it's boilerplate-heavy and error-prone. A built-in supervision model is cleaner for the "let it crash" style of concurrent programming.
Area
Async / concurrency