DBConnectionPoolProvider<C extends DBConnection> class

A pool of DBConnections.

Inheritance

Constructors

DBConnectionPoolProvider(DBConnectionCredential credential, DBConnectionInstantiator<C> connectionInstantiator, {int maxConnections = 1, Duration retryInterval = const Duration(seconds: 1), int maxRetries = 3})

Properties

connectionInstantiator → DBConnectionInstantiator<C>
The Function that creates new connections for the pool.
final
credential → DBConnectionCredential
The credential to create the connections.
final
hashCode → int
The hash code for this object.
no setterinherited
maxConnections → int
The maximum number of connections waiting in the pool.
final
maxRetries → int
The maximum number of retries before create a connection fails.
final
retryInterval → Duration
The retry interval when trying to connect.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → FutureOr<int>
Closes the provider and it's connections.
override
createConnection() → FutureOr<C>
getConnection() → FutureOr<C>
Returns a DBConnection to execute commands.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
releaseConnection(C connection) → FutureOr<bool>
Releases a DBConnection to be reused.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited