From c7dcc9cb1362e397d8d3d184b0643f2ca50c032e Mon Sep 17 00:00:00 2001 From: juhlig Date: Mon, 13 May 2019 11:09:05 +0200 Subject: Change supervisor child specs to maps --- src/ranch_listener_sup.erl | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/ranch_listener_sup.erl') diff --git a/src/ranch_listener_sup.erl b/src/ranch_listener_sup.erl index bf533a9..312b6fc 100644 --- a/src/ranch_listener_sup.erl +++ b/src/ranch_listener_sup.erl @@ -33,11 +33,15 @@ start_link(Ref, Transport, TransOpts, Protocol, ProtoOpts) -> init({Ref, NumAcceptors, NumConnsSups, Transport, Protocol}) -> ok = ranch_server:set_listener_sup(Ref, self()), ChildSpecs = [ - {ranch_conns_sup_sup, {ranch_conns_sup_sup, start_link, - [Ref, NumConnsSups, Transport, Protocol]}, - permanent, infinity, supervisor, [ranch_conns_sup_sup]}, - {ranch_acceptors_sup, {ranch_acceptors_sup, start_link, - [Ref, NumAcceptors, Transport]}, - permanent, infinity, supervisor, [ranch_acceptors_sup]} + #{ + id => ranch_conns_sup_sup, + start => {ranch_conns_sup_sup, start_link, [Ref, NumConnsSups, Transport, Protocol]}, + type => supervisor + }, + #{ + id => ranch_acceptors_sup, + start => {ranch_acceptors_sup, start_link, [Ref, NumAcceptors, Transport]}, + type => supervisor + } ], - {ok, {{rest_for_one, 1, 5}, ChildSpecs}}. + {ok, {#{strategy => rest_for_one}, ChildSpecs}}. -- cgit v1.2.3