Skip to content

Make Supervisor consume itself on stop #43

@ddrcode

Description

@ddrcode

Status

It's a breaking change it must wait until 0.3.0.
Decision to be made - choose between supervisor consuming itself on stop or moving to a stopped state, using typestate logic.

Description

Supervisor is not operational after stop = there is not possible to call start again without error. As such, the rust way would be to make supervisor to consume itself, so stop and run should be defined as mut self rather &mut self.

Considerations

  • Supervisor contained in another struct must be in Option
  • what about join()?
  • what if instead of consuming supervisor on stop we would rather transition it to another state? We could use Typestate generic for that with three options: not-started, running and stopped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions