mongodb-driver v0.6.0 Mongo.Session.SessionPool View Source

A FIFO cache for sessions. To get a new session, call checkout. This returns a new session or a cached session. After running the operation call checkin(session) to put the session into the FIFO cache for reuse.

The MongoDB specifications allows to generate the uuid from the client. That means, that we can just create server sessions and use them for logicial sessions. If they expire then we drop these sessions, otherwise we can reuse the server sessions.

Link to this section Summary

Functions

Checkin a used server session. It if is already expired, the server session is dropped. Otherwise the server session is cache for reuse, until it expires due of being cached all the time.

Return a server session. If the session timeout is not reached, then a cached server session is return for reuse. Otherwise a newly created server session is returned.

Returns a specification to start this module under a supervisor.

Handle a checkout call.

Handle a shutdown cast.

Initiaize an empty cache.

Starts the GenServer. The logical_session_timeout is the timeout in minutes for each server session.

Link to this section Functions

Checkin a used server session. It if is already expired, the server session is dropped. Otherwise the server session is cache for reuse, until it expires due of being cached all the time.

Return a server session. If the session timeout is not reached, then a cached server session is return for reuse. Otherwise a newly created server session is returned.

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

handle_call(msg, from, state) View Source

Handle a checkout call.

Handle a shutdown cast.

Initiaize an empty cache.

Link to this function

start_link(top, logical_session_timeout) View Source

Starts the GenServer. The logical_session_timeout is the timeout in minutes for each server session.