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

Connection pools documentation and example #533

Merged
merged 2 commits into from
Oct 3, 2023

Conversation

MeanSquaredError
Copy link
Contributor

@MeanSquaredError MeanSquaredError commented Sep 30, 2023

This PR adds:

  • A documentation file for connection pools docs/Connection-Pools.md
  • The documentation on threads is slightly expanded.
  • A basic example which shows how to workaround the multithreading issues using connection pools. The sample program creates a thread_local wrapper for a connection handle. The thread_local wrapper exposes all relevant connection methods, in this example it exposes just operator(). The wrapper lazily fetches a connection from the pool the first time when operator() is called. Then the example runs 10 thread, each thread running 5 SQL queries in a loop.

Copy link
Owner

@rbock rbock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the documentation and example!

docs/Connection-Pools.md Outdated Show resolved Hide resolved
docs/Connection-Pools.md Outdated Show resolved Hide resolved
docs/Connection-Pools.md Outdated Show resolved Hide resolved
@rbock
Copy link
Owner

rbock commented Oct 3, 2023

Thanks for documenting and providing examples! Nice work!

@rbock rbock merged commit 7f04435 into rbock:main Oct 3, 2023
1 check passed
@MeanSquaredError MeanSquaredError deleted the conn_pool_doc branch October 9, 2023 05:52
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