const classafMongo::ConnectionManagerPooled

sys::Obj
  afMongo::ConnectionManagerPooled : afMongo::ConnectionManager

Manages a pool of connections.

Connections are created on-demand and kept in a pool when idle.

Note this connection manager is safe for multi-threaded / web-application use.

connectionUri

Source

const Uri connectionUri

The URI this ConnectionManager was configured with.

`mongodb://username:password@example1.com/puppies?maxPoolSize=50`
defaultDatabase

Source

const Str? defaultDatabase

The default database connections are authenticated against.

defaultPassword

Source

const Str? defaultPassword

The default password connections are authenticated with.

defaultUsername

Source

const Str? defaultUsername

The default username connections are authenticated with.

leaseConnection

Source

virtual override Obj? leaseConnection(|Connection->Obj? c)

Makes a connection available to the given function.

All leased connections are authenticated against the default credentials.

makeFromUri

Source

new makeFromUri(ActorPool actorPool, Uri connectionUri)

Create a ConnectionManager from a Mongo Connection URI. If user credentials are supplied, they are used as default authentication for each connection.

The following Uri options are supported:

connectTimeoutMS TODO: socketTimeoutMS TODO: Write Concern Options

URI examples:

`mongodb://username:password@example1.com/database?maxPoolSize=50`
`mongodb://example2.com?minPoolSize=10&maxPoolSize=50`

@see http://docs.mongodb.org/manual/reference/connection-string/

maxPoolSize

Source

const Int maxPoolSize := 10

The maximum number of database connections this pool should open. Set it to the number of concurrent users you expect to use your application.

minPoolSize

Source

const Int minPoolSize := 0

The minimum number of database connections this pool should keep open. They are initially created during startup().

mongoUri

Source

virtual const override Uri mongoUri

The host name of the MongoDB server this ConnectionManager connects to.

shutdown

Source

virtual override ConnectionManager shutdown()

Closes all connections.

startup

Source

virtual override ConnectionManager startup()

Creates the initial pool and establishes minPoolSize connections with the server.