hydra
hydra copied to clipboard
Why are PIDs optional in success states?
I noticed a pattern where PIDs are optional in the success states? They’re already wrapped in results, and if a PID is missing isn’t it an Err anyway?
https://docs.rs/hydra/latest/hydra/struct.Supervisor.html#method.start_child
This covers the case where a child starts, and exits with a Normal/Ignored status, which is also valid in elixir and doesn't cause an error in the supervisor, it continues as-is and doesn't restart the child.
Wouldn’t it make more sense to make that exception its own thing instead of making all instances of returned PID optional?
Or am I missing other scenarios where it could occur?