Module zotonic_filewatcher_beam_reloader

Periodically loads modules whose beam file have been updated.

Copyright © 2009-2018 Marc Worrell

Behaviours: gen_server.

Authors: Marc Worrell (marc@worrell.nl).

Description

Periodically loads modules whose beam file have been updated.

Function Index

code_change/3Convert process state when code is changed.
handle_call/3Trap unknown calls.
handle_cast/2
handle_info/2Periodic check for changed beam files.
init/1Initiates the server.
make/0Perform a make:all() and reload the changed beam files.
reload/0Check if beam files are changed, load the changed ones.
reload_module/1Reload a module, purge the old code.
start_link/1Starts the server.
terminate/2This function is called by a gen_server when it is about to terminate.

Function Details

code_change/3

code_change(OldVsn, State, Extra) -> {ok, NewState}

Convert process state when code is changed

handle_call/3

handle_call(Message::Request, From, State) -> {reply, Reply, State} | {reply, Reply, State, Timeout} | {noreply, State} | {noreply, State, Timeout} | {stop, Reason, Reply, State} | {stop, Reason, State}

Trap unknown calls

handle_cast/2

handle_cast(Message::Msg, State) -> {noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}

handle_info/2

handle_info(Info, State) -> {noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}

Periodic check for changed beam files.

init/1

init(X1::Args) -> {ok, State} | {ok, State, Timeout} | ignore | {stop, Reason}

Initiates the server.

make/0

make() -> any()

Perform a make:all() and reload the changed beam files.

reload/0

reload() -> any()

Check if beam files are changed, load the changed ones.

reload_module/1

reload_module(M) -> any()

Reload a module, purge the old code.

start_link/1

start_link(Periodic::boolean()) -> {ok, Pid} | ignore | {error, Error}

Starts the server

terminate/2

terminate(Reason, State) -> void()

This function is called by a gen_server when it is about to terminate. It should be the opposite of Module:init/1 and do any necessary cleaning up. When it returns, the gen_server terminates with Reason. The return value is ignored.


Generated by EDoc