Copyright © 2009-2012 Marc Worrell
Behaviours: gen_server.
Authors: Marc Worrell (marc@worrell.nl).
session_id() = list()
| add_script/1 | Send the scripts in the context to all pages of all sessions. |
| add_script/2 | Send a script to all pages of all sessions. |
| broadcast/2 | Broadcast a notification message to all open sessions. |
| code_change/3 | |
| continue_session/1 | Continue an existing session. |
| count/1 | Return the number of open sessions. |
| dump/1 | Dump all session to stdout. |
| ensure_session/1 | Start a new session or continue an existing session. |
| fold/3 | Calls Fun on successive sessions together with an extra argument Acc (short for accumulator). |
| foreach/2 | Apply the given function to all sessions. |
| get_session_id/1 | Fetch the session id. |
| handle_call/3 | |
| handle_cast/2 | |
| handle_info/2 | |
| init/1 | Initialize the session server with an empty session table. |
| rename_session/1 | Rename the session id, only call this after ensure_session. |
| start_link/1 | Starts the session manager server. |
| stop_session/1 | Explicitly stop an existing session. |
| terminate/2 | |
| tick/1 | Periodic tick used for cleaning up sessions. |
add_script(Context) -> none()
Send the scripts in the context to all pages of all sessions
add_script(Script::io_list(), Context) -> none()
Send a script to all pages of all sessions
broadcast(Broadcast::#broadcast{}, Context) -> ok
Broadcast a notification message to all open sessions.
code_change(OldVersion, State, Extra) -> any()
continue_session(Context::#context{}) -> {ok, #context{}} | {error, term()}
Continue an existing session. No new session will be created.
count(Context) -> Int
Return the number of open sessions
dump(Context) -> void()
Dump all session to stdout
ensure_session(Context::#context{}) -> {ok, #context{}} | {error, term()}
Start a new session or continue an existing session
fold(Function::function(), Acc0::term(), Context::#context{}) -> Acc::term()
Calls Fun on successive sessions together with an extra argument Acc (short for accumulator). Fun must return a new accumulator which is passed to the next call. Acc0 is returned if the list is empty. The evaluation order is undefined.
foreach(Function::function(), Context::#context{}) -> void()
Apply the given function to all sessions
get_session_id(Context::#context{}) -> undefined | session_id()
Fetch the session id
handle_call(Msg, From, State) -> any()
handle_cast(Msg, Session_srv) -> any()
handle_info(Msg, State) -> any()
init(SiteProps) -> {ok, State}
Initialize the session server with an empty session table. We make the session manager a system process so that crashes in sessions are isolated from each other.
rename_session(Context::#context{}) -> {ok, #context{}} | {error, term()}
Rename the session id, only call this after ensure_session
start_link(SiteProps::list()) -> {ok, pid()} | ignore | {error, term()}
Starts the session manager server
stop_session(Context::#context{}) -> {ok, #context{}} | {error, term()}
Explicitly stop an existing session
terminate(Reason, State) -> any()
tick(SessionManager::pid()) -> void()
Periodic tick used for cleaning up sessions
Generated by EDoc, Dec 10 2012, 20:44:34.