Qore openldap Module 1.3.0
Loading...
Searching...
No Matches
LdapConnectionPool Class Reference

LDAP connection pool for efficient connection reuse. More...

#include <LdapConnectionPool.qm.dox.h>

Public Member Methods

void destructor ()
 Destructor - closes all connections.
 
void withConnection (code callback)
 Executes a callback with a pooled connection.
 
auto withConnectionResult (code callback)
 Executes a callback with a pooled connection and returns the result.
 
hash< auto > getStats ()
 Returns pool statistics.
 
string getUri ()
 Returns the LDAP URI.
 
string getConnectionId (LdapClient conn)
 Returns a unique identifier for a connection object.
 

Public Attributes

const auto DefaultMinConnections = ...
 Default minimum number of connections.
 
const auto DefaultMaxConnections = ...
 Default maximum number of connections.
 
const auto DefaultIdleTimeout = ...
 Default idle timeout in seconds.
 
const auto DefaultWaitTimeout = ...
 Default wait timeout for getting a connection.
 

Private Attributes

string uri
 LDAP URI.
 
hash< auto > opts
 Connection options.
 
hash< auto > poolOpts
 Pool options.
 

Detailed Description

LDAP connection pool for efficient connection reuse.

Member Function Documentation

◆ getStats()

hash< auto > LdapConnectionPool::getStats ( )

Returns pool statistics.

Returns
a hash with pool statistics:
  • available: number of available connections
  • in_use: number of connections in use
  • total: total number of connections
  • min: minimum configured connections
  • max: maximum configured connections

◆ withConnection()

void LdapConnectionPool::withConnection ( code  callback)

Executes a callback with a pooled connection.

Parameters
callbackthe callback to execute with the connection

The connection is automatically returned to the pool after the callback completes, even if an exception is thrown.

◆ withConnectionResult()

auto LdapConnectionPool::withConnectionResult ( code  callback)

Executes a callback with a pooled connection and returns the result.

Parameters
callbackthe callback to execute with the connection
Returns
the return value of the callback

The connection is automatically returned to the pool after the callback completes, even if an exception is thrown.


The documentation for this class was generated from the following file: