Skip to content

Commit f770cc5

Browse files
author
José Valim
committed
Use @impl true annotations
1 parent cb3056e commit f770cc5

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

lib/consumer_supervisor.ex

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ defmodule ConsumerSupervisor do
321321

322322
## Callbacks
323323

324-
@doc false
324+
@impl true
325325
def init({mod, args, name}) do
326326
Process.put(:"$initial_call", {:supervisor, mod, 1})
327327
Process.flag(:trap_exit, true)
@@ -393,7 +393,7 @@ defmodule ConsumerSupervisor do
393393
defp validate_seconds(seconds) when is_integer(seconds), do: :ok
394394
defp validate_seconds(_), do: {:error, "max_seconds must be an integer"}
395395

396-
@doc false
396+
@impl true
397397
def handle_subscribe(:producer, opts, {_, ref} = from, state) do
398398
# GenStage checks these options before allowing susbcription
399399
max = Keyword.get(opts, :max_demand, 1000)
@@ -402,12 +402,12 @@ defmodule ConsumerSupervisor do
402402
{:manual, put_in(state.producers[ref], {from, 0, 0, min, max})}
403403
end
404404

405-
@doc false
405+
@impl true
406406
def handle_cancel(_, {_, ref}, state) do
407407
{:noreply, [], update_in(state.producers, &Map.delete(&1, ref))}
408408
end
409409

410-
@doc false
410+
@impl true
411411
def handle_events(events, {pid, ref} = from, state) do
412412
%{template: child, children: children} = state
413413
{new, errors} = start_events(events, from, child, 0, [], state)
@@ -487,7 +487,7 @@ defmodule ConsumerSupervisor do
487487
end
488488
end
489489

490-
@doc false
490+
@impl true
491491
def handle_call(:which_children, _from, state) do
492492
%{children: children, template: child} = state
493493
{_, _, _, _, type, mods} = child
@@ -584,12 +584,12 @@ defmodule ConsumerSupervisor do
584584
defp exit_reason(:error, reason, stack), do: {reason, stack}
585585
defp exit_reason(:throw, value, stack), do: {{:nocatch, value}, stack}
586586

587-
@doc false
587+
@impl true
588588
def handle_cast(_msg, state) do
589589
{:noreply, [], state}
590590
end
591591

592-
@doc false
592+
@impl true
593593
def handle_info({:EXIT, pid, reason}, state) do
594594
case maybe_restart_child(pid, reason, state) do
595595
{:ok, state} -> {:noreply, [], state}
@@ -625,7 +625,7 @@ defmodule ConsumerSupervisor do
625625
{:noreply, [], state}
626626
end
627627

628-
@doc false
628+
@impl true
629629
def code_change(_, %{mod: mod, args: args} = state, _) do
630630
case mod.init(args) do
631631
{:ok, children, opts} ->
@@ -648,7 +648,7 @@ defmodule ConsumerSupervisor do
648648
end
649649
end
650650

651-
@doc false
651+
@impl true
652652
def terminate(_, %{children: children} = state) do
653653
:ok = terminate_children(children, state)
654654
end
@@ -906,6 +906,7 @@ defmodule ConsumerSupervisor do
906906
]
907907
end
908908

909+
@impl true
909910
def format_status(:terminate, [_pdict, state]) do
910911
state
911912
end

0 commit comments

Comments
 (0)