Table of Contents

Interface IConnectionPool

Namespace
MongoDB.Driver.Core.ConnectionPools
Assembly
MongoDB.Driver.Core.dll

Represents a connection pool.

public interface IConnectionPool : IDisposable
Inherited Members

Properties

Generation

Gets the generation of the connection pool.

int Generation { get; }

Property Value

int

The generation.

ServerId

Gets the server identifier.

ServerId ServerId { get; }

Property Value

ServerId

The server identifier.

Methods

AcquireConnection(CancellationToken)

Acquires a connection.

IConnectionHandle AcquireConnection(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

IConnectionHandle

A connection.

AcquireConnectionAsync(CancellationToken)

Acquires a connection.

Task<IConnectionHandle> AcquireConnectionAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IConnectionHandle>

A Task whose result is a connection.

Clear(ObjectId)

Clears the connection pool for the specified service.

void Clear(ObjectId serviceId)

Parameters

serviceId ObjectId

The service id.

Clear(bool)

Clears the connection pool and marks it as paused.

void Clear(bool closeInUseConnections = false)

Parameters

closeInUseConnections bool

Whether in use connections should be closed.

GetGeneration(ObjectId?)

Gets the current generation for the connection pool (or service).

int GetGeneration(ObjectId? serviceId)

Parameters

serviceId ObjectId?

The optional service Id.

Returns

int

The connection pool generation.

Initialize()

Initializes the connection pool.

void Initialize()

SetReady()

Marks the pool as ready.

void SetReady()