Skip to content

Supervised tasks RFC #34

Description

@brianp

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:

  • Automatic task restart with configurable backoff
  • Max retries before giving up
  • Supervisor trees (supervisors that supervise other supervisors)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    asyncAsync, concurrency, channels, tasksfeatureNew language feature or capabilityrfcTied to a specific RFC or design doc

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions