Giter Club home page Giter Club logo

Comments (3)

kyeah avatar kyeah commented on July 17, 2024

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.

freiguy1 avatar freiguy1 commented on July 17, 2024

Very good, thanks!

from mongo-rust-driver-prototype.

YjyJeff avatar YjyJeff commented on July 17, 2024

Can I set the pool size?

from mongo-rust-driver-prototype.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.