Skip to content

Commit

Permalink
Unify field name
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikWolek committed Feb 7, 2024
1 parent 8485c44 commit a3b7941
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ defmodule Membrane.Core.Parent.ChildLifeController.CrashGroupUtils do
end
end

def handle_crash_group_member_death(child_name, %CrashGroup{} = group, reason, state) do
def handle_crash_group_member_death(child_name, %CrashGroup{} = group, crash_reason, state) do
state =
if group.detonating? do
state
else
detonate_crash_group(child_name, group, reason, state)
detonate_crash_group(child_name, group, crash_reason, state)
end

all_members_dead? =
Expand All @@ -72,7 +72,7 @@ defmodule Membrane.Core.Parent.ChildLifeController.CrashGroupUtils do
end
end

defp detonate_crash_group(crash_initiator, %CrashGroup{} = group, reason, state) do
defp detonate_crash_group(crash_initiator, %CrashGroup{} = group, crash_reason, state) do
state = ChildLifeController.remove_children_from_specs(group.members, state)
state = LinkUtils.unlink_crash_group(group, state)

Expand All @@ -89,7 +89,7 @@ defmodule Membrane.Core.Parent.ChildLifeController.CrashGroupUtils do
&1
| detonating?: true,
crash_initiator: crash_initiator,
reason: reason
crash_reason: crash_reason
}
)
end
Expand All @@ -110,7 +110,7 @@ defmodule Membrane.Core.Parent.ChildLifeController.CrashGroupUtils do
&Component.context_from_state(&1,
members: crash_group.members,
crash_initiator: crash_group.crash_initiator,
crash_reason: crash_group.reason
crash_reason: crash_group.crash_reason
)

CallbackHandler.exec_and_handle_callback(
Expand Down
4 changes: 2 additions & 2 deletions lib/membrane/core/parent/crash_group.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ defmodule Membrane.Core.Parent.CrashGroup do
members: [Membrane.Child.name()],
detonating?: boolean(),
crash_initiator: Membrane.Child.name(),
reason: :normal | :shutdown | {:shutdown, term()} | term()
crash_reason: :normal | :shutdown | {:shutdown, term()} | term()
}

@enforce_keys [:name, :mode]
defstruct @enforce_keys ++
[members: [], detonating?: false, crash_initiator: nil, reason: nil]
[members: [], detonating?: false, crash_initiator: nil, crash_reason: nil]
end

0 comments on commit a3b7941

Please sign in to comment.