ConnectionPool class
A connection pool that limits the number of concurrent connections to a MongoDB server.
The connection pool lazily connects to the database; that is to say, it only opens as many connections as it needs to. If it is only ever called once, then it will only ever connect once.
Constructors
- ConnectionPool(int maxConnections, DbFactory dbFactory)
- Initializes a connection pool.
Properties
- dbFactory → DbFactory
-
A DbFactory, a parameterless function that returns a Db. The function can be asynchronous if necessary.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxConnections → int
-
The maximum number of concurrent connections allowed.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → Future - Closes all active database connections.
-
connect(
) → Future< Db> - Connects to the database, using an existent connection, only creating a new one if the number of active connections is less than maxConnections.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited