Code Monkey home page Code Monkey logo

Comments (1)

pwtail avatar pwtail commented on June 21, 2024

Hi @dvarrazzo The thing is this is a sync backend, and DatabaseWrapper instances are created per-thread. So it means that I have 1 pool per thread. The pool is actually not needed at all because 1 thread only needs 1 connection at a time.

But I use the pool here as a logical entity. Because even if you need only one connection, that connection also has a lifetime after which it should be recreated, the health checks should be made from time to time, etc - the very same things you do to connections in the pool. So I need the pool just to reuse the logic of working with a single connection.

Now, about the size: I think, size=1 corresponds to the current logic of django's own postgresql backend. But you can probably have 2 connections when you know 1 connection is about to die so that to return the new connection immediately. But that is kind of optimisation.

from vinyl_v1.

Related Issues (8)

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.