Copyright © 2009 Marc Worrell
Behaviours: gen_server.
Authors: Marc Worrell (marc@worrell.nl).
add_script/1 | Split the scripts from the context and add the scripts to the session pages. |
add_script/2 | Send a script to all session pages. |
check_expire/2 | Check session and page expiration, periodically called by the session manager. |
code_change/3 | Convert process state when code is changed. |
dump/1 | Dump the session details. |
ensure_page_session/1 | Make sure that the request has a page session, when the page session was alive then adjust the expiration of the page. |
get/2 | |
get_attach_state/1 | Check the state of all the attached pages. |
get_persistent/2 | |
handle_call/3 | Handling call messages. |
handle_cast/2 | |
handle_info/2 | |
incr/3 | |
init/1 | |
keepalive/1 | Reset the expire counter of the session, called from the page process when comet attaches. |
keepalive/2 | Reset the timeout counter of the page and session according to the current tick. |
persistent_id/1 | |
restart/1 | Reset the session contents, keep the persistent data. |
set/3 | |
set_persistent/3 | |
spawn_link/4 | Spawn a new process, linked to the session pid. |
start_link/2 | |
stop/1 | |
terminate/2 | This function is called by a gen_server when it is about to terminate. |
add_script(Context) -> Context1
Split the scripts from the context and add the scripts to the session pages.
add_script(Script::io_list(), PagePid::pid()) -> none()
Send a script to all session pages
check_expire(Now::integer(), Pid::pid()) -> none()
Check session and page expiration, periodically called by the session manager
code_change(OldVsn, Session::State, Extra) -> {ok, NewState}
Convert process state when code is changed
dump(Pid) -> any()
Dump the session details
ensure_page_session(Context::#context{}) -> #context{}
Make sure that the request has a page session, when the page session was alive then adjust the expiration of the page. Returns a new context with the page id set.
get(Key, Context) -> any()
get_attach_state(Context::#context{}) -> [States]
Check the state of all the attached pages.
get_persistent(Key, Context) -> any()
handle_call(Msg::Request, From, Session::State) -> {reply, Reply, State} | {reply, Reply, State, Timeout} | {noreply, State} | {noreply, State, Timeout} | {stop, Reason, Reply, State} | {stop, Reason, State}
Handling call messages
handle_cast(Msg, Session) -> any()
handle_info(X1::Info, Session::State) -> {noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}
incr(Key, Value, Context) -> any()
init(X1) -> any()
keepalive(Pid) -> any()
Reset the expire counter of the session, called from the page process when comet attaches
keepalive(PageId, Pid) -> any()
Reset the timeout counter of the page and session according to the current tick
persistent_id(Context) -> any()
restart(Pid) -> any()
Reset the session contents, keep the persistent data. Used in the case where an user restarts his browser.
set(Key, Value, Context) -> any()
set_persistent(Key, Value, Context) -> any()
spawn_link(Module, Func, Args, Context) -> any()
Spawn a new process, linked to the session pid
start_link(PersistId, Context) -> any()
stop(Pid) -> any()
terminate(Reason, Session::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. Terminate all processes coupled to the session.
Generated by EDoc, Feb 25 2011, 21:14:41.