Module z_dropbox

Simple dropbox handler, monitors a directory and signals new files.

Copyright © 2009-2020 Marc Worrell

Behaviours: gen_server.

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

Description

Simple dropbox handler, monitors a directory and signals new files.

Function Index

code_change/3Convert process state when code is changed.
handle_call/3Trap unknown calls.
handle_cast/2Scan the dropbox, broadcast found files.
handle_info/2Handling all non call/cast messages.
init/1Initiates the server.
scan/1Perform a scan of the dropbox, periodically called by a timer.
start_link/1Starts the dropbox 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}

Scan the dropbox, broadcast found files.

handle_info/2

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

Handling all non call/cast messages

init/1

init(SiteProps) -> {ok, State} | {ok, State, Timeout} | ignore | {stop, Reason}

Initiates the server. Options are: dropbox_dir, processing_dir, unhandled_dir, interval, max_age and min_age

scan/1

scan(Context::context()) -> void()

Perform a scan of the dropbox, periodically called by a timer.

start_link/1

start_link(SiteProps::SiteArgs) -> {ok, Pid} | ignore | {error, Error}

Starts the dropbox 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