gleam_otp's static supervisor discards the data from ChildSpecifications of its children when they are added, which means that I can't just e.g. use start functions for children that return ChildSpecification(Subject(Message)) and return something like a struct containing the default subjects of the children from the start function of my supervisor.
My understanding, then, is that in order to actually access a Subject for a child, I need to either:
- pass names down the supervision hierarchy to give to the static children and use named subjects; or
- register the subjects as a side-effect in the actual actor construction function (i.e. a side-effect in the function called in
static_supervisor.add).
In my case, the hierarchy that I'm trying to establish looks something like this:
┌────────────────────────┐
│Root Supervisor (static)│
└──┬──────────────────┬──┘
│ │
┌──────────┴──┐ ┌─────┴──────────────────────┐
│Manager Actor│ │Monitor Supervisor (factory)│
└─────────────┘ └─────────────┬──────────────┘
▲ │
│ ┌────┴───┐
└─────────────────────────┤Monitors│
updates └────────┘
with the idea that some external things (e.g. an HTTP server elsewhere in the tree) may communicate with this module through the sending and receipt of messages with the Manager Actor. So in a naïve sense, my goal is mostly to be able to make available a Subject for communicating with the Manager Actor in the calling context that establishes the Root Supervisor. Hopefully that's somewhat clear; I'm very new to all this 😅