Supervisor shutdown

Ulf Wiger ulf.wiger@REDACTED
Tue Nov 25 11:04:42 CET 2003


On Tue, 25 Nov 2003 10:32:35 +0100, Vlad Dumitrescu 
<vlad_dumitrescu@REDACTED> wrote:

> From: "HEINRICH VENTER" <HEINRICH.VENTER@REDACTED>
>> So how do I stop the application  and ensure that my gen_server 
>> terminate code
> gets executed??
>
> Hi,
>
> It should work without any tweaks. From documentation of gen_server, the
> terminate callback:
>
> If the gen_server is part of a supervision tree and is ordered by its 
> supervisor to terminate, this function will be called with
> Reason=shutdown if the following conditions apply:
>     -the gen_server has been set to trap exit signals, and
>     -the shutdown strategy as defined in the supervisor's
>      child specification is an integer timeout value,
>      not brutal_kill.

...and the gen_server has been started with gen_server:start_link(...),
not gen_server:start(...).

/Uffe
-- 
Ulf Wiger, Senior System Architect
EAB/UPD/S



More information about the erlang-questions mailing list