Support for terminate in z_dummy_module #458

Closed
mmzeeman opened this Issue Nov 13, 2012 · 2 comments

Projects

None yet

3 participants

@mmzeeman
Member

It would be really nice to have support for a module terminate call in z_dummy module. This would allow one to not only start but also stop things. Dummy module currently supports init only.

Example

-module(mod_example).

-mod_title("Example.").
-mod_prio(500).

-include_lib("zotonic.hrl").

-export([init/1, terminate/2]).

init(Context) ->
   start_something_important(Context),
    {ok, []}.

terminate(_Reason, Context) ->
    stop_something_important(Context),
    ok.
@kaos
Member
kaos commented Nov 13, 2012

+1

2012/11/13 Maas-Maarten Zeeman notifications@github.com

It would be really nice to have support for a module terminate call in
z_dummy module. This would allow one to not only start but also stop
things. Dummy module currently supports init only.

Example

-module(mod_example).

-mod_title("Example.").
-mod_prio(500).

-include_lib("zotonic.hrl").

-export([init/1, terminate/2]).

init(Context) ->
start_something_important(Context),
{ok, []}.

terminate(_Reason, Context) ->
stop_something_important(Context),
ok.


Reply to this email directly or view it on GitHubhttps://github.com/zotonic/zotonic/issues/458.

@mmzeeman mmzeeman closed this in a5bcb2b Nov 13, 2012
@mworrell
Member

Nice addition!

@rpip rpip pushed a commit to rpip/zotonic that referenced this issue Aug 12, 2013
@mmzeeman mmzeeman Added optional terminate callback support to non gen_server zotonic m…
…odules. Fixes #458
b46e80e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment