{ "info": { "author": "nvdv", "author_email": "aflatnine@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Topic :: Software Development" ], "description": "atq\n===\n``atq`` is a pure-Python asynchronous task queue built to work with ``asyncio``.\nIt is designed to run costly functions outside main event loop using\ndistributed workers.\n\n``atq`` requires Python 3.5+ and is distributed under BSD license.\n\nUsage\n-----\nFirst, you should start workers on the servers you plan to use for task execution\n\n.. code-block ::\n\n atqserver --host --port --worker \n\nwhere\n\n- ```` is a hostname of the server\n- ```` is a port that server will listen on\n- ```` is a number of worker processes\n\nPlease note that code of tasks should be accessible by ``atq``, so it's advised\nto run ``atq`` server from your project root directory in more complex\nsituations.\n\nThen you will need to create a client using hostnames and ports of initialized\nservers:\n\n.. code-block:: python\n\n import atq\n\n q = atq.Q([\n (\"localhost\", 12345),\n ])\n\n\nFinally you can use ``atq`` in your code:\n\n.. code-block:: python\n\n import atq\n import asyncio\n import requests\n from collections import ChainMap\n from collections import Counter\n\n URLS = [\n ...\n ]\n\n q = atq.Q([\n (\"localhost\", 12345),\n ])\n\n def top_words(url, n):\n \"\"\"Returns top n words from text specified by url.\"\"\"\n text = requests.get(url).text.split()\n return {url: Counter(text).most_common(n)}\n\n async def get_top_words(urls, n):\n \"\"\"Returns top n words in documents specified by URLs.\"\"\"\n tops_in_url = await asyncio.gather(\n *[q.q(top_words, url, n) for url in urls])\n return ChainMap(*tops_in_url)\n\n top = asyncio.get_event_loop().run_until_complete(get_top_words(URLS, 10))\n\nYou can find more examples in ``examples`` subdirectory.\n\nInstallation\n------------\n.. code-block ::\n\n pip3 install atq\n\n\nTesting\n-------\n.. code-block ::\n\n python3 setup.py test\n\n\nLicense\n-------\nBSD\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/nvdv/atq", "keywords": "task queue,asyncio,async", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "atq", "package_url": "https://pypi.org/project/atq/", "platform": "", "project_url": "https://pypi.org/project/atq/", "project_urls": { "Homepage": "http://github.com/nvdv/atq" }, "release_url": "https://pypi.org/project/atq/0.0.2/", "requires_dist": [ "cloudpickle (>=0.4)" ], "requires_python": ">=3.5", "summary": "Async task queue for Python", "version": "0.0.2" }, "last_serial": 3280421, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "db6f1a811e9a906afe29ee2afc95abab", "sha256": "ce2c1e7fe40aeffb931be6e4787d9441361bdc9743ba450ba9035d7582c73659" }, "downloads": -1, "filename": "atq-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "db6f1a811e9a906afe29ee2afc95abab", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 6248, "upload_time": "2017-09-14T08:47:38", "url": "https://files.pythonhosted.org/packages/00/b7/2976932973c5d39c4376ec846ca88da95641e024db300e1cf9fdf2b0b381/atq-0.0.1-py3-none-any.whl" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "9eba691f8a324b52e9ca9fb33e99c97e", "sha256": "95922b23b5f62d4f35568f033890e37d714f1e94eecd77c28c7fd4ba8bab8d85" }, "downloads": -1, "filename": "atq-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "9eba691f8a324b52e9ca9fb33e99c97e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 8024, "upload_time": "2017-10-26T09:42:51", "url": "https://files.pythonhosted.org/packages/63/01/334c22ec318b5769066af1872efcc1b854fc4b626300a03ec43b1def61d7/atq-0.0.2-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9eba691f8a324b52e9ca9fb33e99c97e", "sha256": "95922b23b5f62d4f35568f033890e37d714f1e94eecd77c28c7fd4ba8bab8d85" }, "downloads": -1, "filename": "atq-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "9eba691f8a324b52e9ca9fb33e99c97e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 8024, "upload_time": "2017-10-26T09:42:51", "url": "https://files.pythonhosted.org/packages/63/01/334c22ec318b5769066af1872efcc1b854fc4b626300a03ec43b1def61d7/atq-0.0.2-py3-none-any.whl" } ] }