[erlang-patches] Re: [erlang-questions] Possible supervisor patch

Filipe David Manana <>
Wed Dec 22 16:03:16 CET 2010


Can I get someone from the OTP team to comment on this as well?

thanks

On Sat, Dec 18, 2010 at 3:57 PM, Filipe David Manana
<> wrote:
> Exactly, that was my workaround, and the motivation for that patch was
> exactly to make it atomic.
>
> Thanks
>
> On Sat, Dec 18, 2010 at 2:58 PM, Robert Virding
> <> wrote:
>> You can do it today with:
>>
>> restart_child(Sup, Id, NewSpec) ->
>>    supervisor:terminate_child(Sup, Id),
>>    supervisor:delete_child(Sup, Id),
>>    supervisor:start_child(Sup, NewSpec).
>>
>> BUT, it would not be guaranteed to be an atomic operation and it is up to the caller to ensure that the id remains the same.
>>
>> Robert
>>
>> ----- "Filipe David Manana" <> wrote:
>>
>>> Hi,
>>>
>>> I find it useful to be able to restart a supervisor child with
>>> arguments different from those specified in the MFA component of the
>>> original child spec.
>>> Is this completely against the principles of OTP supervisors/servers,
>>> or something that may be added?
>>>
>>> I made a quick and tiny patch that adds this feature and is working as
>>> I want:
>>>
>>> https://github.com/fdmanana/otp/commit/a80f39109292c915ce56ea86b7e036b581f686b2
>>>
>>> If someone from the OTP team confirms this might be considered for
>>> inclusion, I'll be glad to refine it if necessary.
>>>
>>> best regards,
>>>
>>> --
>>> Filipe David Manana,
>>> , 
>>>
>>> "Reasonable men adapt themselves to the world.
>>>  Unreasonable men adapt the world to themselves.
>>>  That's why all progress depends on unreasonable men."
>>>
>>> ________________________________________________________________
>>> erlang-questions (at) erlang.org mailing list.
>>> See http://www.erlang.org/faq.html
>>> To unsubscribe; mailto:
>>
>> --
>> Robert Virding, Erlang Solutions Ltd.
>>
>> ________________________________________________________________
>> erlang-patches (at) erlang.org mailing list.
>> See http://www.erlang.org/faq.html
>> To unsubscribe; mailto:
>>
>>
>
>
>
> --
> Filipe David Manana,
> , 
>
> "Reasonable men adapt themselves to the world.
>  Unreasonable men adapt the world to themselves.
>  That's why all progress depends on unreasonable men."
>



-- 
Filipe David Manana,
, 

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."


More information about the erlang-patches mailing list