Module z_media_preview_server

Server to execute command line resizes.

Copyright 2009 Marc Worrell Date: 2009-07-22

Behaviours: gen_server.

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

Description

Server to execute command line resizes. Prevents competing resize processes when an image on a "hot" page is replaced. Probably the smallest server built in a long while.

Function Index

code_change/3Convert process state when code is changed.
exec/2Handle the resize command prepared by z_media_preview.
handle_call/3Execute an OS command, return the result.
handle_cast/2Trap unknown casts.
handle_info/2Handling all non call/cast messages.
init/1Initiates the server.
start_link/0Starts the server.
start_link/1
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

exec/2

exec(OSCommand, ResultFile) -> string()

Handle the resize command prepared by z_media_preview. Checks if the result file is already present, if so then the command is not executed.

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}

Execute an OS command, return the result. Checks if the result file is already present, if so then the command is not executed.

handle_cast/2

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

Trap unknown casts

handle_info/2

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

Handling all non call/cast messages

init/1

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

Initiates the server.

start_link/0

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

Starts the server

start_link/1

start_link(Args) -> any()

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, Aug 21 2014, 09:13:18.