Behaviours: gen_server.
state() = #state{}
add_new_session_entry/1* | store a new session and return if succeeded. |
close_all_sessions/0 | close all sessions, gracefully shutdown. |
close_session/1* | delete and trigger a close at the session. |
code_change/3 | does nothting. |
create_new_session/0* | create a new session. |
delete_session/1* | delete the session with the given id. |
delete_sessions/1* | delete list of sessions. |
do_delete_all_sessions/0* | delete all sessions. |
get_all_sessions/0* | get all active sessions. |
get_cookie_data/1 | get the max age and the content of the cookie for the session. |
get_session/1 | get a session by the cookie data, just a simple ets lookup. |
get_unique_token/0* | generate a unique token that can be stored in a cookie. |
handle_call/3 | handle the calls coming in from the plublic functions. |
handle_cast/2 | handle the stop cast form the stop function. |
handle_info/2 | ignore all other messages. |
init/1 | init the session manager process. |
lookup_session_pid/1* | lookup a session by its id. |
new_session/0 | create a new session. |
repeat_token_gen_if_needed/1* | repeat the generation of the token until it is unique. |
session_terminating/1 | a session died purge it. |
session_wants_to_close/1 | a session wants to close, remove it and send a close back. |
set_token_for_session/2* | set the token for the session. |
start_link/0 | start link implementation of the gen_server. |
start_session/1* | start a session and set the token. |
stop/0 | send a cast to stop the process. |
terminate/2 | do nothing, just stop. |
add_new_session_entry(Token::binary()) -> {ok, binary()} | {error, used}
store a new session and return if succeeded
close_all_sessions() -> ok
close all sessions, gracefully shutdown
close_session(ID::any()) -> ok
delete and trigger a close at the session
does nothting
create_new_session() -> {ok, pid()}
create a new session
delete_session(ID::any()) -> ok
delete the session with the given id
delete_sessions(T::[#{id => Id::any(), pid => pid()}]) -> ok
delete list of sessions
do_delete_all_sessions() -> ok
delete all sessions
get_all_sessions() -> [#{id => Id::any(), pid => pid()}]
get all active sessions
get_cookie_data(Session::pid()) -> {ok, MaxAge::pos_integer(), CookieData::binary()}
get the max age and the content of the cookie for the session.
get_session(Cookie::binary() | undefined) -> {ok, pid() | undefined}
get a session by the cookie data, just a simple ets lookup
get_unique_token() -> binary()
generate a unique token that can be stored in a cookie
To do
handle the calls coming in from the plublic functions
handle the stop cast form the stop function
ignore all other messages
init(X1::noparams) -> {ok, state()}
init the session manager process
lookup_session_pid(ID::any()) -> {ok, pid() | undefined}
lookup a session by its id
new_session() -> {ok, pid()}
create a new session
repeat_token_gen_if_needed(X1::{ok, binary()} | {error, atom()}) -> binary()
repeat the generation of the token until it is unique
session_terminating(ID::any()) -> ok
a session died purge it
session_wants_to_close(Token::binary()) -> ok
a session wants to close, remove it and send a close back
set_token_for_session(Token::binary(), Pid::pid()) -> ok
set the token for the session
start_link() -> {ok, pid()}
start link implementation of the gen_server
start_session(Token::binary()) -> pid()
start a session and set the token
stop() -> ok
send a cast to stop the process
terminate(Reason::any(), State::state()) -> ok
do nothing, just stop
Generated by EDoc