{ "info": { "author": "Roberto Abdelkader Martinez Perez", "author_email": "robertomartinezp@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "ThreadedProcessPoolExecutor\n===========================\n\n.. image:: https://img.shields.io/pypi/v/threadedprocess.svg\n :target: https://pypi.python.org/pypi/threadedprocess\n\n.. image:: https://img.shields.io/pypi/l/threadedprocess.svg\n :target: https://pypi.python.org/pypi/threadedprocess\n\n.. image:: https://img.shields.io/pypi/pyversions/threadedprocess.svg\n :target: https://pypi.python.org/pypi/threadedprocess\n\n.. image:: https://travis-ci.org/nilp0inter/threadedprocess.svg?branch=master\n :target: https://travis-ci.org/nilp0inter/threadedprocess\n\n\nThe `ThreadedProcessPoolExecutor` class is an `Executor` subclass that uses a\npool of process with an inner pool of threads on each process to execute calls\nasynchronously.\n\n`ThreadedProcessPoolExecutor` is formed by a modified `ProcessPoolExecutor`\nthat processes (with at most *max_processes*) that use a `ThreadPoolExecutor`\ninstance (with at most *max_threads*) to run the given tasks.\n\nIf *max_processes* is ``None`` or not given, it will default to the number\nof processors on the machine.\n\nIf *max_threads* is ``None`` or not given, it will default to the number of\nprocessors on the machine, multiplied by ``5``.\n\n\nExample\n~~~~~~~\n\n.. code-block:: python\n\n from concurrent.futures import as_completed\n import math\n \n from threadedprocess import ThreadedProcessPoolExecutor\n import requests\n \n RNGURL = \"https://www.random.org/integers/?num=1&min=1&max=100000000&col=1&base=10&format=plain&rnd=new\"\n \n \n def get_prime():\n n = int(requests.get(RNGURL).text)\n \n if n % 2 == 0:\n return (n, False)\n \n sqrt_n = int(math.floor(math.sqrt(n)))\n for i in range(3, sqrt_n + 1, 2):\n if n % i == 0:\n return (n, False)\n return (n, True)\n \n \n with ThreadedProcessPoolExecutor(max_processes=4, max_threads=16) as executor:\n futures = []\n \n for _ in range(128):\n futures.append(executor.submit(get_prime))\n \n for future in as_completed(futures):\n print('%d is prime: %s' % future.result())\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nilp0inter/threadedprocess", "keywords": "concurrent futures executor process thread", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "threadedprocess", "package_url": "https://pypi.org/project/threadedprocess/", "platform": "", "project_url": "https://pypi.org/project/threadedprocess/", "project_urls": { "Homepage": "https://github.com/nilp0inter/threadedprocess" }, "release_url": "https://pypi.org/project/threadedprocess/0.0.5/", "requires_dist": null, "requires_python": "", "summary": "A `ThreadedProcessPoolExecutor` is formed by a modified `ProcessPoolExecutor` that generates processes that use a `ThreadPoolExecutor` instance to run the given tasks.", "version": "0.0.5" }, "last_serial": 3700175, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "928f28b6e2bf35efd5632e696c75ca1b", "sha256": "004b7adb1643eb6e714e53421831885c554267856d89ec5f92a1d9cdc83a7015" }, "downloads": -1, "filename": "threadedprocess-0.0.1.tar.gz", "has_sig": false, "md5_digest": "928f28b6e2bf35efd5632e696c75ca1b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3112, "upload_time": "2018-03-23T15:13:58", "url": "https://files.pythonhosted.org/packages/2c/0d/9083cfc41a5cce2e6ce9917fcd10e6d8d00f7773dceab2a33dc8c5a0c3a4/threadedprocess-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "09f66acc6909e4384348dc8e20932d75", "sha256": "ecc1574db7ab20364b4ac03765974c55420aed271e8487eadb609d09ad616bf8" }, "downloads": -1, "filename": "threadedprocess-0.0.2.tar.gz", "has_sig": false, "md5_digest": "09f66acc6909e4384348dc8e20932d75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3275, "upload_time": "2018-03-23T15:18:05", "url": "https://files.pythonhosted.org/packages/d5/9a/aef40cfd2ea4fbdd7765eddf9be9998280597d7b6514ea89eadd154cef5e/threadedprocess-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "18b235a3811042669cbebbc9fa0d46b5", "sha256": "104fa118c9963036148fd7b7677d1c818c56df3d3438fdb523bc8ced2fd2fbc7" }, "downloads": -1, "filename": "threadedprocess-0.0.3.tar.gz", "has_sig": false, "md5_digest": "18b235a3811042669cbebbc9fa0d46b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3395, "upload_time": "2018-03-23T17:53:31", "url": "https://files.pythonhosted.org/packages/76/02/fc78bafdfa6e718527f522e514758f23479dec6ddd255162ba479cd6d729/threadedprocess-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "e26d4e44edeb77aedadde40c20e7416d", "sha256": "331bd0cd1e7ae50158c656dc469a5aaa93cfe2da6792a06de9445915ebda98a7" }, "downloads": -1, "filename": "threadedprocess-0.0.4.tar.gz", "has_sig": false, "md5_digest": "e26d4e44edeb77aedadde40c20e7416d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4009, "upload_time": "2018-03-23T20:19:34", "url": "https://files.pythonhosted.org/packages/3a/a4/a697faacbbc960f0e53eb40be7ae6f7f4ef349e3f0fb6444f23b22439fe0/threadedprocess-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "7e9a036554699bcd6d18f7b263696cc1", "sha256": "712e8b711eefc82e052857b0a5b1c911c987819dd9d94ccb9d7b3aeb035a46ae" }, "downloads": -1, "filename": "threadedprocess-0.0.5.tar.gz", "has_sig": false, "md5_digest": "7e9a036554699bcd6d18f7b263696cc1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3973, "upload_time": "2018-03-23T20:33:58", "url": "https://files.pythonhosted.org/packages/17/5a/bc35b33ea71f498823892c2c46fe1190a276b1e05eaa476f7076f5ff4ad6/threadedprocess-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7e9a036554699bcd6d18f7b263696cc1", "sha256": "712e8b711eefc82e052857b0a5b1c911c987819dd9d94ccb9d7b3aeb035a46ae" }, "downloads": -1, "filename": "threadedprocess-0.0.5.tar.gz", "has_sig": false, "md5_digest": "7e9a036554699bcd6d18f7b263696cc1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3973, "upload_time": "2018-03-23T20:33:58", "url": "https://files.pythonhosted.org/packages/17/5a/bc35b33ea71f498823892c2c46fe1190a276b1e05eaa476f7076f5ff4ad6/threadedprocess-0.0.5.tar.gz" } ] }