Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/membrane/utility_supervisor.ex doc edits #746

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions lib/membrane/utility_supervisor.ex
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
defmodule Membrane.UtilitySupervisor do
@moduledoc """
A supervisor that allows to start utility processes under the pipeline's
A supervisor responsible for managing utility processes under the pipeline's
supervision tree.

The supervisor is spawned with each component and can be obtained from
callback contexts.
The supervisor is spawned with each component and can be accessed from callback contexts.

The supervisor never restarts any processes, it just makes sure they
terminate when the component that started them terminates. If restarting
is needed, a dedicated supervisor should be spawned under this supervisor, like
`Membrane.UtilitySupervisor` does not restart processes. Rather, it ensures that these utility processes
terminate gracefully when the component that initiated them terminates.

If a process needs to be able to restart, spawn a dedicated supervisor under this supervisor.

## Example

def handle_setup(ctx, state) do
Membrane.UtilitySupervisor.start_link_child(
Expand All @@ -26,7 +28,7 @@ defmodule Membrane.UtilitySupervisor do
@doc """
Starts a process under the utility supervisor.

Semantics of the `child_spec` argument is the same as in `Supervisor.child_spec/2`.
Semantics of the `child_spec` argument are the same as in `Supervisor.child_spec/2`.
"""
@spec start_child(t, Supervisor.child_spec() | {module(), term()} | module()) ::
Supervisor.on_start_child()
Expand All @@ -37,7 +39,7 @@ defmodule Membrane.UtilitySupervisor do
@doc """
Starts a process under the utility supervisor and links it to the current process.

Semantics of the `child_spec` argument is the same as in `Supervisor.child_spec/2`.
Semantics of the `child_spec` argument are the same as in `Supervisor.child_spec/2`.
"""
@spec start_link_child(t, Supervisor.child_spec() | {module(), term()} | module()) ::
Supervisor.on_start_child()
Expand Down
Loading