{ "info": { "author": "ikh software, inc.", "author_email": "ikh@ikhsoftware.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "queuepool - A multithread-safe resource pool based on synchronized queue\n========================================================================\n\nThe main problem with psycopg2.pool (https://github.com/psycopg/psycopg2/blob/master/lib/pool.py), for example, is that the pool raises an exception (instead of blocking) when there are no more connections in the pool, and you either have to match the number of connections to the number of workers, or implement retry logic. Also, it doesn't implement connection recycling (on timeout or usage count), and therefore, doesn't fully address issue with stale connections and suited less (scales worse) for large production installations.\n\nThis implementation is based on synchronized queue (https://docs.python.org/3/library/queue.html), and thus multithred safe. This is a streamlined port from Java version that was implemented about ten years ago and that has since then been running in heavy production evironment of one of our financial clients.\n\nThis implementation features: \n\n* A pool of generic resources that can be extended for specific resources like psycopg2 connections. Psycopg2 connection pool implementation is provided.\n* On-demand lazy resource opening.\n* Idle and open timeout recycling. Requires user code to execute `pool.recycle()` method periodically (or start recycler thread by `pool.startRecycler()`), for example, once a minute. If this method isn\u2019t executed periodically, then the recycling is performed only when the resource are either taken or returned back to the pool, and therefore, the pool can accumulate a number of idle connections that exceed the idle or open timeouts.\n* Usage count recycling.\n* Recycling on exception.\n* Recycling on a resource status.\n* Context manager allows to use the pool with \"with\" context manager so that the resources could be returned safely to the pool.\n* LIFO queue helps the pool keep number of open resources to the minimum. \n\nThis pool can be utilized successfully in large production installations as it tries to keep the number of open resources to the minimum, yet providing sufficient number of \u201chot\u201d (open) resources to avoid open/close cost.\n\nLicense\n-------\n\nOSI Approved 3 clause BSD License\n\nPrerequisites\n-------------\n\n* Python 3.7+ (with queue)\n* For psycopg2 connections: psycopg2 2.8.2+\n\nInstallation\n------------\n\nIf prerequisites are met, you can install `queuepool` like any other Python package, using pip to download it from PyPI:\n\n $ pip install queuepool\n\nor using `setup.py` if you have downloaded the source package locally:\n\n $ python setup.py build\n $ sudo python setup.py install\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/ikh/queuepool", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "queuepool", "package_url": "https://pypi.org/project/queuepool/", "platform": "", "project_url": "https://pypi.org/project/queuepool/", "project_urls": { "Bug Reports": "https://bitbucket.org/ikh/queuepool/issues", "Homepage": "https://bitbucket.org/ikh/queuepool" }, "release_url": "https://pypi.org/project/queuepool/1.3.0/", "requires_dist": [ "psycopg2 (>=2.8.2)" ], "requires_python": ">= 3.7", "summary": "A multithread-safe resource pool based on synchronized queue", "version": "1.3.0" }, "last_serial": 5309405, "releases": { "1.0.4": [ { "comment_text": "", "digests": { "md5": "a6a3b0bf5531dfa143e7a1389ca7e427", "sha256": "77b1140dafcca4a3c64bc4661e9edf49025018c4e2925d47acb745b2e327d0fd" }, "downloads": -1, "filename": "queuepool-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "a6a3b0bf5531dfa143e7a1389ca7e427", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.7", "size": 10540, "upload_time": "2019-05-01T06:29:20", "url": "https://files.pythonhosted.org/packages/93/b9/c7a6344e0e1e2d2065186d7880a7019586c201b3acaa716627252998ffa7/queuepool-1.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8337df4a828303a2f912920b3ef81e48", "sha256": "cd2024277f4d2d66a927ed2f1dc5e9711de0d9549a9016bcb70c40af9c3711e6" }, "downloads": -1, "filename": "queuepool-1.0.4.tar.gz", "has_sig": false, "md5_digest": "8337df4a828303a2f912920b3ef81e48", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.7", "size": 5800, "upload_time": "2019-05-01T06:29:26", "url": "https://files.pythonhosted.org/packages/db/98/0c072e44d2916230ed0b92f2d1290c25079d36517a134f3032e318413c17/queuepool-1.0.4.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "5666b5f29d96ff39ae3044c17009db8e", "sha256": "768ce476bd1b456c9d5a24e2faf4dcb3f5e64795f849817378074250ba4375a5" }, "downloads": -1, "filename": "queuepool-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5666b5f29d96ff39ae3044c17009db8e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.7", "size": 10552, "upload_time": "2019-05-16T18:59:16", "url": "https://files.pythonhosted.org/packages/eb/a8/f4905793e6812d019bc80d7638254c6eede5da4c8a07ca271dc505188f91/queuepool-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "00211fd3c1443e06e49bc7f1da7d6ad6", "sha256": "38cb2fb18e591ba785d30446a85f4e6cc9f30a6e5d0682e7f7f273b3045faa77" }, "downloads": -1, "filename": "queuepool-1.1.0.tar.gz", "has_sig": false, "md5_digest": "00211fd3c1443e06e49bc7f1da7d6ad6", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.7", "size": 5822, "upload_time": "2019-05-16T18:59:19", "url": "https://files.pythonhosted.org/packages/bf/b4/f153c11bf07256e5624272450a3a141e49ec0c9cdd8e4b342afb1720f55d/queuepool-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "5f96e89b6a8df8c5f77e36099918b486", "sha256": "3fea60dc298061ad6af0797a60e3226113d8a58eddd2cd15085d6c6d555d2535" }, "downloads": -1, "filename": "queuepool-1.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5f96e89b6a8df8c5f77e36099918b486", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.7", "size": 11058, "upload_time": "2019-05-20T17:36:32", "url": "https://files.pythonhosted.org/packages/48/c7/fe7951e9db9ee027ed6ced57d012319148f35c75c5012a611f9371c881f9/queuepool-1.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a867d027d3233f0b91131924d81d337a", "sha256": "6e0dcca63b8360a8303e4787d1902aed2d291ba307fbf454da1fe7ca3cd32424" }, "downloads": -1, "filename": "queuepool-1.2.0.tar.gz", "has_sig": false, "md5_digest": "a867d027d3233f0b91131924d81d337a", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.7", "size": 6325, "upload_time": "2019-05-20T17:36:34", "url": "https://files.pythonhosted.org/packages/55/66/f5808f46b41b264a0eafb7d312d34b3ebb990a493023e7d3251f35841220/queuepool-1.2.0.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "be5478f8b12a216ebcce5a32499ddba8", "sha256": "107a83486eab3b3c4066b74d64a27f852eee3456221f64163d082eecf58fd8a7" }, "downloads": -1, "filename": "queuepool-1.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "be5478f8b12a216ebcce5a32499ddba8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.7", "size": 12481, "upload_time": "2019-05-23T20:40:20", "url": "https://files.pythonhosted.org/packages/b6/b0/8f99823ef2f2ea9d8f7e9a5ee7dd91362e4eec1a21fc439a9c99910b9904/queuepool-1.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5f1238e0e95b890ced65263a0f77a6d1", "sha256": "cb468f8e3af230448a2d0f4501e5c79ca797fc2dd2d3e5b14462312f9c9f8dc4" }, "downloads": -1, "filename": "queuepool-1.3.0.tar.gz", "has_sig": false, "md5_digest": "5f1238e0e95b890ced65263a0f77a6d1", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.7", "size": 6910, "upload_time": "2019-05-23T20:40:22", "url": "https://files.pythonhosted.org/packages/5d/22/02dd30c699d65b96a19227804c09899af4d26ad2bfec00eaeb677c46c6c0/queuepool-1.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "be5478f8b12a216ebcce5a32499ddba8", "sha256": "107a83486eab3b3c4066b74d64a27f852eee3456221f64163d082eecf58fd8a7" }, "downloads": -1, "filename": "queuepool-1.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "be5478f8b12a216ebcce5a32499ddba8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.7", "size": 12481, "upload_time": "2019-05-23T20:40:20", "url": "https://files.pythonhosted.org/packages/b6/b0/8f99823ef2f2ea9d8f7e9a5ee7dd91362e4eec1a21fc439a9c99910b9904/queuepool-1.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5f1238e0e95b890ced65263a0f77a6d1", "sha256": "cb468f8e3af230448a2d0f4501e5c79ca797fc2dd2d3e5b14462312f9c9f8dc4" }, "downloads": -1, "filename": "queuepool-1.3.0.tar.gz", "has_sig": false, "md5_digest": "5f1238e0e95b890ced65263a0f77a6d1", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.7", "size": 6910, "upload_time": "2019-05-23T20:40:22", "url": "https://files.pythonhosted.org/packages/5d/22/02dd30c699d65b96a19227804c09899af4d26ad2bfec00eaeb677c46c6c0/queuepool-1.3.0.tar.gz" } ] }