hydra icon indicating copy to clipboard operation
hydra copied to clipboard

Why are PIDs optional in success states?

Open seivan opened this issue 10 months ago • 2 comments

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

seivan avatar Jun 17 '25 13:06 seivan

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.

Image

dtzxporter avatar Jun 17 '25 15:06 dtzxporter

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?

seivan avatar Jun 18 '25 10:06 seivan