Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ability to externalize MongoClient creation #4262

Conversation

alkampfergit
Copy link

Best practice for usage of MongoClient is creating a single instance for the entire process. (or a single instance for each different connection string).

Actual code create a new MongoClient and uses a local cache to limit the number of client, but with this commit we allow the caller to redefine the function to create MongoClient and use an external cache (or use decorators, etc).

This is needed so the caller program can implement
a system to have a single MongoClient for the entire
application. Actually the driver already uses an
internal cache to have only one MongoClient but
with this commit we can let the user decide how
to create the MongoClient.
@alkampfergit alkampfergit force-pushed the feature/mongodb_externalize_mongoclient_creation branch from 3d1bf22 to 4ad158a Compare July 27, 2023 08:08
@sfmskywalker sfmskywalker merged commit 559829c into elsa-workflows:master Jul 27, 2023
7 checks passed
@alkampfergit alkampfergit deleted the feature/mongodb_externalize_mongoclient_creation branch August 1, 2023 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants