Class Mongo::Session::SessionPool
In: lib/mongo/session/session_pool.rb
Parent: Object

A pool of server sessions.

@api private

@since 2.5.0

Methods

checkin   checkout   create   end_sessions   inspect   new  

Public Class methods

Create a SessionPool.

@example

  SessionPool.create(cluster)

@param [ Mongo::Cluster ] cluster The cluster that will be associated with this

  session pool.

@since 2.5.0

Initialize a SessionPool.

@example

  SessionPool.new(cluster)

@param [ Mongo::Cluster ] cluster The cluster that will be associated with this

  session pool.

@since 2.5.0

Public Instance methods

Checkin a server session to the pool.

@example Checkin a session.

  pool.checkin(session)

@param [ Session::ServerSession ] session The session to checkin.

@since 2.5.0

Checkout a server session from the pool.

@example Checkout a session.

  pool.checkout

@return [ ServerSession ] The server session.

@since 2.5.0

End all sessions in the pool by sending the endSessions command to the server.

@example End all sessions.

  pool.end_sessions

@since 2.5.0

Get a formatted string for use in inspection.

@example Inspect the session pool object.

  session_pool.inspect

@return [ String ] The session pool inspection.

@since 2.5.0

[Validate]