Comments (3)
Hey, I didn't see this issue until now! The connection pool is maintained internally by a MongoDB Client, so you shouldn't ever have to deal with the pool directly. MongoDB apps are designed to have one Client across the entire application, so developers can clone Client (which is actually an alias of an Arc type), allowing them to use multiple references of the same connection pool.
This is discussed a little bit in #135.
... Client is actually just an alias of an Arc type, which means you can open the connection at the top of the function and then just use .clone() to get an (owned) atomic reference to it inside each of your routes that need it.
It sounds like you are doing this in your application, which is great! If you're using cloned references to a single Client, the internal connection pool will automatically handle connection recycling for you and create new connections under heavy load.
from mongo-rust-driver-prototype.
Very good, thanks!
from mongo-rust-driver-prototype.
Can I set the pool size?
from mongo-rust-driver-prototype.
Related Issues (20)
- Authentication succeeds while it shouldn't HOT 14
- Load all documents at once instead of getting a cursor HOT 2
- Duplicate Key error not detected HOT 10
- Large writes fail with broken pipe error HOT 2
- Cursor getMore OperationErrors not handled properly. HOT 4
- No servers available for the provided ReadPreference, yet again HOT 12
- Serialize struct with u32 field HOT 5
- problem on DateTime<Utc> type HOT 1
- Old FindOneAndUpdate struct HOT 2
- How to set slaveOk with atlas replica set? HOT 2
- Is there any way to reconnect the db again? HOT 4
- Schema validation HOT 2
- Example in README is not working HOT 1
- Authentication failure when using with actix-web HOT 2
- Does auth() actually works on Mongo 4.2.0? HOT 2
- Performance is still bad #2 HOT 8
- AWS DocumentDB compatibility HOT 4
- ClientInner never release HOT 4
- Document from HashMap HOT 2
- Project Status HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongo-rust-driver-prototype.