Code Monkey home page Code Monkey logo

Comments (3)

fiorix avatar fiorix commented on July 23, 2024

When I originally designed the driver, the rationale behind these classes were:

  1. MongoConnection would connect immediately to the DB, and yield would make it "block" till the connection was established. Useful for writing batch clients;
  2. MongoConnectionPool would do the same as above, but setting up a pool of multiple connections;
  3. lazyMongoConnection would trigger a background connection, returning immediately, making it suitable for using in servers (e.g. web servers), where you create a handler to the db while firing up the server, but generally don't want to wait for the connection to be established. Also, even if the DB wasn't available at the time the server started, it'd eventually (re)connect in background later;
  4. lazyMongoConnectionPool was the same as the previous one, but setting up a pool of connections.

These classes were later deprecated on commit 67addfa in favor of ConnectionPool, but apparently the examples weren't updated.

The current ConnectionPool class takes only 2 arguments: uri and pool_size, which defaults to mongodb://127.0.0.1:27017 and 1 respectively.

I hope this clarifies things a bit. This code definitely needs more cleanups and documentation but I have no plans to work on it for now.

from txmongo.

milutz avatar milutz commented on July 23, 2024

Thats a great help, much thanks!

I'm currently tied in quite a knot with the driver (for some reason I'm dieing with a key error inside the driver seemingly tied to authentication (... which I wasn't under the impression I had enabled.)

I'm in the process of tracing it now and I'll submit issues if anything seems to actually be driver related (not just me misusing it). I understand this isn't active for you right now, so if I find anything and I really think I have a fix I'll build it out and do a pull request.

Thanks for you feedback.

from txmongo.

fiorix avatar fiorix commented on July 23, 2024

Great, good luck!

from txmongo.

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.