Behaviours: gen_server.
config() = #{id => binary(), key_location => binary(), term() => term()}
key() = map()
keys() = [key()]
state() = #state{id = undefined | binary(), keys = any(), key_location = undefined | binary(), location_type = none | file | url, http_req_id = any(), http_result = any(), reading_keys = any(), last_error = any(), next_try = any()}
code_change/3 | do nothing. |
deadline_in/1* | calculate the next deadline. |
extract_rsp_keys/1* | extract the keys from the data (either file or http response). |
fetch_rsp_keys/2* | trigger the async http request. |
get_keys/1 | return the chached keys. |
get_last_error/1 | return the last error. |
get_location_type/1* | get the location type, either file or url of the keys. |
get_rsp_keys/1* | get the keys by reading the file or triggering the http request. |
handle_call/3 | handle the get error/keys calls. |
handle_cast/2 | handle the request to reread keys or stop. |
handle_decode_result/1* | handle the decode result. |
handle_http_client_crash/2* | handle crashing of the http client. |
handle_http_result/1* | handle the http response. |
handle_http_result/4* | handle a http result and extract rsp keys. |
handle_info/2 | handle the async incoming http responses when fetching keys. |
handle_key_result/1* | handle the decoding result, either store the keys in stat or skip. |
init/1 | initilize the process. |
maybe_cancel_request/2* | maybe cancel a current running http request. |
maybe_trigger_key_read/1* | maybe trigger reading the keys again. |
new/1 | start a new rsp gen_server process. |
reread/1 | triger a reading of the keys. |
reread_keys_if_needed/1* | rereadkeys if deadline reached. |
result_or_default/2* | return either value if present, if not default. |
safe_decode/2* | safely decode any data by returning on success or default on failure. |
start_link/1 | start the gen_server linked to the supervisor. |
stop/1 | stop the process. |
terminate/2 | do nothing. |
do nothing
deadline_in(Seconds::non_neg_integer()) -> non_neg_integer()
calculate the next deadline
extract_rsp_keys(X1::{ok | integer(), string() | binary()} | {error, any()}) -> {ok, keys()} | {error, any()}
extract the keys from the data (either file or http response)
trigger the async http request
get_keys(Pid::pid() | undefined) -> {ok, keys()}
return the chached keys
get_last_error(Pid::pid()) -> {ok, any()}
return the last error
get_location_type(Url::binary()) -> {binary(), file | url} | {none, unknown}
get the location type, either file or url of the keys
get the keys by reading the file or triggering the http request
handle_call(Request::any(), From::any(), State::state()) -> {reply, any(), state(), non_neg_integer()}
handle the get error/keys calls
handle_cast(Request::any(), State::state()) -> {noreply, state(), non_neg_integer()} | {stop, normal, state()}
handle the request to reread keys or stop
handle_decode_result(X1::map() | any()) -> {ok, keys()} | {error, bad_data}
handle the decode result
handle crashing of the http client
handle the http response.
handle a http result and extract rsp keys
handle the async incoming http responses when fetching keys
handle the decoding result, either store the keys in stat or skip
initilize the process
maybe_cancel_request(X1::boolean(), Id::any()) -> ok
maybe cancel a current running http request
maybe_trigger_key_read(X1::boolean()) -> ok
maybe trigger reading the keys again
new(Map::config()) -> {ok, pid()}
start a new rsp gen_server process
reread(Pid::pid()) -> ok
triger a reading of the keys
reread_keys_if_needed(State::state()) -> ok
rereadkeys if deadline reached
result_or_default(X1::{ok, any()} | any(), Default::any()) -> any()
return either value if present, if not default
safe_decode(Data::binary(), Default::any()) -> any()
safely decode any data by returning on success or default on failure
start_link(Map::config()) -> {ok, pid()}
start the gen_server linked to the supervisor
stop(Pid::pid()) -> ok
stop the process
terminate(Reason::any(), State::state()) -> ok
do nothing
Generated by EDoc