@@ -592,7 +592,7 @@ defmodule Supervisor do
592
592
## Options
593
593
594
594
* `:strategy` - the restart strategy option. It can be either
595
- `:one_for_one`, `:rest_for_one`, `:one_for_all`, or
595
+ `:one_for_one`, `:rest_for_one`, `:one_for_all`, or the deprecated
596
596
`:simple_one_for_one`.
597
597
598
598
* `:max_restarts` - the maximum number of restarts allowed in
@@ -722,14 +722,6 @@ defmodule Supervisor do
722
722
#=> %{id: {Agent, 1},
723
723
#=> start: {Agent, :start_link, [fn -> :ok end]}}
724
724
725
- It may also be used when there is a need to change the number
726
- of arguments when starting a module under a `:simple_one_for_one`
727
- strategy, since most args may be given dynamically:
728
-
729
- Supervisor.child_spec(Agent, start: {Agent, :start_link, []})
730
- #=> %{id: Agent,
731
- #=> start: {Agent, :start_link, []}}
732
-
733
725
"""
734
726
@ spec child_spec ( child_spec ( ) | { module , arg :: term } | module , keyword ) :: child_spec ( )
735
727
def child_spec ( module_or_map , overrides )
@@ -821,13 +813,13 @@ defmodule Supervisor do
821
813
returns `{:error, error}` where `error` is a term containing information about
822
814
the error and child specification.
823
815
"""
824
- @ spec start_child ( supervisor , :supervisor . child_spec ( ) | { module , term } | module ) ::
816
+ @ spec start_child ( supervisor , :supervisor . child_spec ( ) | { module , term } | module | [ term ] ) ::
825
817
on_start_child
826
818
def start_child ( supervisor , { _ , _ , _ , _ , _ , _ } = child_spec ) do
827
819
call ( supervisor , { :start_child , child_spec } )
828
820
end
829
821
830
- # TODO: Deprecate this on Elixir v1.8
822
+ # TODO: Deprecate this on Elixir v1.8. Remove and update typespec on v2.0.
831
823
def start_child ( supervisor , args ) when is_list ( args ) do
832
824
call ( supervisor , { :start_child , args } )
833
825
end
0 commit comments