feat: add pool_maxsize parameter to connection managers #651
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a
pool_maxsizeparameter to theKeycloakOpenIDandKeycloakAdminclasses. This parameter is passed to the internalConnectionManager, allowing users to configure the maximum number of connections to keep in the connection pool.Motivation/Context
Controlling the connection pool size is important for managing resource usage and improving performance in applications that make frequent calls to Keycloak. By exposing this parameter, users of the library can fine-tune the connection behaviour to better suit their environment and workload, potentially reducing overhead from establishing new connections.
Should resolve: #630
Testing Evidence
pool_maxsizeparameter to relevant test fixtures intests/conftest.pywith a non-default value (5).tests/test_keycloak_openid.py(test_keycloak_openid_initandtest_a_well_known) to verifypool_maxsizeis correctly set on theConnectionManagerforKeycloakOpenID.tests/test_keycloak_admin.py(test_keycloak_admin_initandtest_a_realms) to verifypool_maxsizeis correctly set on theConnectionManagerforKeycloakAdmin.