[erlang-questions] prep_stop in an included application

Alex Vazquez alexvazquezfente@REDACTED
Thu May 21 08:32:26 CEST 2009


2009/5/20 Ulf Wiger <ulf.wiger@REDACTED>

>
> This is true also for the start function and the
> start phase callbacks.
>
> It is your responsibility to take care of the included
> applications.
>

> In the AXD 301, we had a generic top-level application
> callback that would look for environment variables
> in the included applications - e.g. {'#prep_stop#', {M,F}}.
>

I see ... well i finally managed to solve my problem by calling an
included-application API function from the primary prep_stop callback.
Although it seems to me not the best solution, it works, and i have no time
of implementing a more generic solution like the one you mention.

Anyway, just for curiosity, there would be any reason preventing some kind
of stop_phases scheme or it's just that nobody found it that necessary
and/or had the time to do it?

Regards,


> BR,
> Ulf W
>
>
> Alex Vazquez wrote:
>
>> Hi list,
>>
>> I would like to know if there is a way of forcing the execution of the
>> prep_stop() callback for an included application that is started by adding
>> its supervisor to the primary application supervisor.
>>
>> The scenario i'm facing includes a primary application that launches some
>> included applications, with some of them launching another applications too:
>>
>> Prim
>> IncA, IncB,
>> IncA1, IncA2
>>
>> Here, i need to manipulate the supervisor of the included application
>> (say, IncA) just before it stops, to allow deleting its own included apps
>> (say IncA1 and IncA2) before it terminates, doing it from inside the
>> included application and not from the primary one.
>>
>> I'm experiencing that the prep_stop callback is only called for the
>> primary application and not for the included ones.
>>
>> I now it can sound a bit akward. I can explain a bit further if needed.
>>
>> Thanks in advance,
>>
>> --
>> Alejandro Vazquez Fente
>>
>
>
>
> --
> Ulf Wiger
> CTO, Erlang Training & Consulting Ltd
> http://www.erlang-consulting.com
>



-- 
Alejandro Vazquez Fente
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090521/5c400795/attachment.htm>


More information about the erlang-questions mailing list