{ "info": { "author": "James Arthur", "author_email": "thruflo@googlemail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: Public Domain", "Programming Language :: Python" ], "description": "Overview\n--------\n\nTorque is a web hook task queue based on Tornado_ and redis_. It's designed to\nsolve two problems in the context of a web application:\n\n#. you want to do something later\n#. you want to do a number of things in parallel\n\nThere are many ways of approaching these problems. For example, in python, you \nmight look at Twisted_, Celery_ and Stackless_. \n\nTorque is inspired by Google App Engine's taskqueue_, which models_ tasks as \nwebhooks_. This approach allows you to handle tasks within your normal web \napplication environment by writing request handlers, just as you would to handle \na user initiated request.\n\nTo use it, you need to run:\n\n#. a redis_ database\n#. ``./bin/torque-serve``, which exposes a Tornado_ application (by default on\n ``http://localhost:8889``)\n#. one ``./bin/torque-process`` per queue\n\nOr, if you're just using the default queue, you can replace ``./bin/torque-serve`` and ``./bin/torque-process`` with:\n\n#. ``./bin/torque-run``\n\nWhich runs the web application and the process loop in seperate threads.\n\nYou can process queues ad infinitum, or until they are empty. See\n``torque.process.QueueProcessor.__doc__`` for the details.\n\nYou can add tasks to the queue in two ways:\n\n#. by posting an HTTP request to the Tornado_ application run by ``./bin/torque-serve``\n#. or by using the python client api in ``torque.client``\n\nThis first method allows you to use Torque from any programming language. The second\nmakes it much simpler if you're using python.\n\nTo add a task using an HTTP request, post to ``/add_task`` with two params:\n\n* ``url`` which is the url to the webhook you want the task to request\n* ``params`` which is a json encoded dictionary of the params you want\n to post to the webhook you're requesting\n\nAn example in python (with the Tornado application available on ``localhost``,\nrunning on port ``8889``) would be::\n\n import json\n import urllib\n \n mytask = {\n 'url': 'http://mywebservice.com/hooks/do/foo',\n 'params': json.dumps({'foo', 'somevalue', 'baz': 99})\n }\n target_url = 'http://localhost:8889/add_task'\n urllib.urlopen(target_url, urllib.urlencode(mytask))\n\nThis queued a POST request to ``http://mywebservice.com/hooks/do/foo`` with\nthe params ``foo=somevalue`` and ``baz=99`` to be made as soon as possible.\n\nYou can do something similar using any programming language that can make url \nrequests. However, if you are using python, it's much simpler to use the client \napi that Torque provides::\n\n from torque.client import add_task\n t = add_task(url='http://mywebservice.com/hooks/do/foo', params={'a': 1})\n\nNote that this doesn't require json encoding the params. For all the client api\noptions, see ``torque.client.Task.__doc__``.\n\nIndividual tasks backoff exponentially if they error, upto a maximum backoff delay\nthat's configurable as ``--max_task_delay``, until they error ``--max_task_errors`` \ntimes (at which point they get deleted).\n\n\nInstall\n-------\n\nInstall the redis_ and Tornado_ dependencies. Then install Torque::\n\n $ easy_install torque\n\nOr manually from source::\n\n $ git clone git://github.com/thruflo/torque.git\n $ cd torque\n $ python setup.py install\n\n\nRun\n---\n\nRun redis_::\n\n $ ./redis-server\n\nStart the `Tornado`_ application::\n\n $ ./bin/torque-serve\n\nIf you want to run the tests, use::\n\n $ ./bin/nosetests -w ./src/torque --with-doctest\n .......\n ----------------------------------------------------------------------\n Ran 7 tests in 22.627s\n \n OK\n\nStart the default task queue running ad infinitum::\n\n $ ./bin/torque-process\n\nSee ``--help`` against either of the torque console scripts for a list of configuration\noptions. For example, to run a second queue called ``foobar``, you might use::\n\n ./bin/torque-process --queue_name=foobar\n\nOr to process the default queue once until empty you might use::\n\n ./bin/torque-process --finish_on_empty=true --max_task_errors=3\n\nOr to do exactly the same from python code::\n \n from torque.processor import QueueProcessor\n QueueProcessor(max_task_errors=3).process(finish_on_empty=true)\n\nRead the source code for more information.\n\n.. _webhooks: http://wiki.webhooks.org/\n.. _models: http://code.google.com/appengine/docs/python/taskqueue/overview.html#Task_Concepts\n.. _taskqueue: http://code.google.com/appengine/docs/python/taskqueue/\n.. _redis: http://code.google.com/p/redis/\n.. _Tornado: http://www.tornadoweb.org/\n.. _Twisted: http://twistedmatrix.com/trac/\n.. _Celery: http://ask.github.com/celery/introduction.html\n.. _Stackless: http://www.stackless.com/\n.. _SortedSet: http://code.google.com/p/redis/wiki/SortedSets\n.. _asyncronously: http://www.tornadoweb.org/documentation#non-blocking-asynchronous-requests", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/thruflo/torque", "keywords": null, "license": "Creative Commons CC0 1.0 Universal", "maintainer": null, "maintainer_email": null, "name": "torque", "package_url": "https://pypi.org/project/torque/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/torque/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/thruflo/torque" }, "release_url": "https://pypi.org/project/torque/0.4.5/", "requires_dist": null, "requires_python": null, "summary": "A web hook task queue based on tornado and redis", "version": "0.4.5" }, "last_serial": 800826, "releases": { "0.3": [], "0.3.1": [ { "comment_text": "", "digests": { "md5": "1280f4ea031ab0ce9e23b130ab615e42", "sha256": "e6cb9e87989bc48938c1f01b3968734e2a76705a1971499adbadad14c8e2e3f0" }, "downloads": -1, "filename": "torque-0.3.1.tar.gz", "has_sig": false, "md5_digest": "1280f4ea031ab0ce9e23b130ab615e42", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12801, "upload_time": "2009-12-26T20:00:40", "url": "https://files.pythonhosted.org/packages/a7/52/4ab97c14da2c621576a73d1f8196c1cef96aafd8f22e30bf1374e13bcdbf/torque-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "af78a0dfcbc121d05655b16dc46dcd33", "sha256": "b71370d86ed804437fc834266cce4cf3e94866bba801a6b29c356e392e8464cf" }, "downloads": -1, "filename": "torque-0.3.2.tar.gz", "has_sig": false, "md5_digest": "af78a0dfcbc121d05655b16dc46dcd33", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14615, "upload_time": "2009-12-28T17:33:06", "url": "https://files.pythonhosted.org/packages/46/6e/30acef064e7d6b493b09b0d051eac2c6da054c939e2380949dd01cb8cfd3/torque-0.3.2.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "8e60e336c930870842f46da68b5d10fa", "sha256": "b1bc9597d6e7aa5f17bed8912232ae64811f840c214bb193766bdd62c48d1846" }, "downloads": -1, "filename": "torque-0.4.tar.gz", "has_sig": false, "md5_digest": "8e60e336c930870842f46da68b5d10fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16995, "upload_time": "2009-12-29T16:02:52", "url": "https://files.pythonhosted.org/packages/fa/cb/906345b620b22d943533e9a7494d1694a73c89900c8d3cbaae88decf2c53/torque-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "2535244160b4d1079749400eb46b8a02", "sha256": "5940874623097d33286e03bf420da208a12fc0cdd9ac8b5e885e5e966fc3102d" }, "downloads": -1, "filename": "torque-0.4.1.tar.gz", "has_sig": false, "md5_digest": "2535244160b4d1079749400eb46b8a02", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16892, "upload_time": "2009-12-29T16:15:51", "url": "https://files.pythonhosted.org/packages/4c/06/3cc7ae2a43cc5b9711ae32f16d8139aacb1e8c7634ef3157bfaadb8e46cb/torque-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "7a23f97f9a06e38749c8c50a80f325f6", "sha256": "6fea7566bc4bf9741acb5c6af67670f9fe067f5e6101ca407feefe30ed9f8b3c" }, "downloads": -1, "filename": "torque-0.4.2.tar.gz", "has_sig": false, "md5_digest": "7a23f97f9a06e38749c8c50a80f325f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17040, "upload_time": "2010-01-04T17:19:45", "url": "https://files.pythonhosted.org/packages/24/dc/525c209a3c4783b2723bdcf03e0940820bf190775904625a2b3a2d147712/torque-0.4.2.tar.gz" } ], "0.4.3": [ { "comment_text": "", "digests": { "md5": "3cf840eb12395b00d6fa5f7040f3a930", "sha256": "6cf31c536ec4facb453a574a2295c5a98ad997aa5316826dd320afb80a572f5d" }, "downloads": -1, "filename": "torque-0.4.3.tar.gz", "has_sig": false, "md5_digest": "3cf840eb12395b00d6fa5f7040f3a930", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17694, "upload_time": "2010-01-08T11:49:39", "url": "https://files.pythonhosted.org/packages/44/d1/90afcc044e9c16d5a36762509f2c504f7c1e4ceebceb81655b7213e12b64/torque-0.4.3.tar.gz" } ], "0.4.4": [ { "comment_text": "", "digests": { "md5": "c48c0db4bf83802f1bac8877d80fc91e", "sha256": "be96f277451ab5e23faef0a1536c31e924a375a844600bb4293ce0889ddaa501" }, "downloads": -1, "filename": "torque-0.4.4.tar.gz", "has_sig": false, "md5_digest": "c48c0db4bf83802f1bac8877d80fc91e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17701, "upload_time": "2010-01-16T18:17:34", "url": "https://files.pythonhosted.org/packages/bc/d9/3058cf79df31313301320adbc7018c090bd9d5c32db9b176944432b1d10e/torque-0.4.4.tar.gz" } ], "0.4.5": [ { "comment_text": "", "digests": { "md5": "1b4e8118f06ae2a6be43278b29320e62", "sha256": "8a45d852e04428decf8f991d3da56497ea1435454cf61f1054c8b049649cf261" }, "downloads": -1, "filename": "torque-0.4.5.tar.gz", "has_sig": false, "md5_digest": "1b4e8118f06ae2a6be43278b29320e62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17824, "upload_time": "2010-02-07T21:17:22", "url": "https://files.pythonhosted.org/packages/b7/ed/f0d034945991052b2e5858c4133622463089b169c5747dd769fede305018/torque-0.4.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1b4e8118f06ae2a6be43278b29320e62", "sha256": "8a45d852e04428decf8f991d3da56497ea1435454cf61f1054c8b049649cf261" }, "downloads": -1, "filename": "torque-0.4.5.tar.gz", "has_sig": false, "md5_digest": "1b4e8118f06ae2a6be43278b29320e62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17824, "upload_time": "2010-02-07T21:17:22", "url": "https://files.pythonhosted.org/packages/b7/ed/f0d034945991052b2e5858c4133622463089b169c5747dd769fede305018/torque-0.4.5.tar.gz" } ] }