NAME

Zaphod::Session::Multiplexer - Multiplexer for JS requests

$session->gen_session_key SESSION_ARGS

Generates a string for uniquely/opaquely identifying a session.

$mx->add_session KEY, ARGS

Adds new session to the list of sessions.

$mx->save_sessions DIR

Saves all sessions into the given directory.

$mx->load_session FILE

Loads a session from a .meta file and adds it to the list. Returns the newly created session.

$mx->session_for_client

Returns the session a client belongs to.

$mx->new_session DOCUMENT_ID

Returns a new session as initialized from the session_args. The session is automatically added to the list of active sessions.

If DOCUMENT_ID is a false value, a document id will be generated via gen_session_key.

document VISUAL, SESSION_KEY, STATE

Forwards the request for the document to the corresponding session.

If no fitting session is found, redirects to the list of sessions. Well, maybe later.

XXX

$mx->connect_client SESSION_KEY, ARGS

Connects a client to the specified session. If the session doesn't exist or is a false value, a new session is created and the client is connected to it.

The parameters for the session are taken from the session_args array.

disconnect_client

users

actions

If a session for the client cannot be found, it is rejected, otherwise these methods are forwarded to the implementation in Zaphod::Session::API::JS.

TODO