pub fn spawn_sibling<S, T>(child: T) -> ChildIdExpand description
Spawns a child onto the ambient supervisor, the nearest supervisor above the current process.
The child belongs to that supervisor, not to the current process. The process does not wait for the child, and does not stop it.
The child is a sibling of the current process only if a supervisor runs that process directly. A process in a scope
has no supervisor of its own. For such a process, the ambient supervisor is the nearest supervisor above it, and the
child runs beside the worker of that supervisor that the process descends from. For example, everything that a
topology component spawns runs in the scope of the component. Thus, a child that a task of the component spawns with
this function runs under the topology supervisor, beside the components. That supervisor does not restart children,
so if such a child fails and must be restarted, the whole topology stops. Use spawn unless the child must
outlive the current process.
The child is hosted, unless the specification says otherwise. The child is not restored when the supervisor itself
restarts. See SupervisorHandle::spawn.
ยงPanics
Panics if there is no ambient supervisor. This means that the caller does not run as a supervised process, or in a
supervised process. Establish an ambient supervisor with SupervisorHandle::scope, or spawn through a
SupervisorHandle directly.