Module watts_temp_cred_data

This module implements the temporary data storage holding the translation result from a plugin.

Behaviours: gen_server.

Description

This module implements the temporary data storage holding the translation result from a plugin. It is implemented as a gen_server behaviour so that each result is stored in its own process. The process dies once it has been read or after a configurable timeout, 10 seconds by default.

Data Types

state()

state() = #state{credential = undefined | watts:credential()}

Function Index

code_change/3implementation of 'code_change' for the behaviour, does nothing.
get_credential/1sending a call to retrieve the credential.
handle_call/3implementation of 'handle_call'.
handle_cast/2implementation of 'handle_cast'.
handle_info/2implementation of 'handle_info'.
init/1initialize the process with a credential.
start/1starting the non-linked gen_server with the credential.
start_link/1starting the linked gen_server with the credential.
stop/1stopping the gen_server.
terminate/2implementation of 'terminate' for the behaviour, does nothing.

Function Details

code_change/3

code_change(OldVsn::any(), State::state(), Extra::any()) -> {ok, state()}

implementation of 'code_change' for the behaviour, does nothing.

get_credential/1

get_credential(Pid::pid()) -> {ok, watts:credential()}

sending a call to retrieve the credential

handle_call/3

handle_call(X1::get_credential, From::any(), State::state()) -> {stop, normal, {ok, watts:credential()}, state()}

implementation of 'handle_call'. This just returns the credential if asked and then stops.

handle_cast/2

handle_cast(X1::stop, State::state()) -> {stop, normal, state()}

implementation of 'handle_cast'. This only reacts to stop and then stops the process.

handle_info/2

handle_info(X1::timeout, State::state()) -> {stop, normal, state()}

implementation of 'handle_info'. This only reacts to timeout and then stops the process.

init/1

init(Credential::watts:credential()) -> {ok, state(), Timeout::non_neg_integer()}

initialize the process with a credential

start/1

start(Credential::watts:credential()) -> {ok, pid()}

starting the non-linked gen_server with the credential.

start_link/1

start_link(Credential::watts:credential()) -> {ok, pid()}

starting the linked gen_server with the credential

stop/1

stop(Pid::pid()) -> ok

stopping the gen_server

terminate/2

terminate(Reason::any(), State::any()) -> ok

implementation of 'terminate' for the behaviour, does nothing.


Generated by EDoc