{ "info": { "author": "Alex Lee", "author_email": "lyd.alexlee.public@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: Implementation :: CPython" ], "description": "Totoro\n======\n.. image:: https://img.shields.io/pypi/v/totoro.svg\n :target: https://pypi.python.org/pypi/totoro\n\n.. image:: https://img.shields.io/pypi/dm/totoro.svg\n :target: https://pypi.python.org/pypi/totoro\n\nCelery integration with Tornado.\n\nInstallation\n------------\n\nYou can install Totoro either via the Python Package Index (PyPI) or from source.\n\nTo install using pip, simply:\n\n.. code-block:: bash\n\n $ sudo pip install totoro\n\nor alternatively (you really should be using pip though):\n\n.. code-block:: bash\n\n $ sudo easy_install totoro\n\nor from source:\n\n.. code-block:: bash\n\n $ sudo python setup.py install\n\nTotoro can only support AMQP(RabbitMQ) by default. To use the Redis, you can specify the requirements on the pip comand-line by using brackets.\n\n.. code-block:: bash\n\n $ sudo pip install totoro[redis]\n\nHello, world\n------------\n\nHere is a simple \"Hello, world!\" example for calling celery tasks from Tornado RequestHandler:\n\n.. code-block:: python\n\n #!/usr/bin/env python\n \n import tornado.httpserver\n import tornado.ioloop\n import tornado.web\n \n from tornado import gen\n import totoro\n from totoro.test.celery_tasks import tasks\n \n \n class MainHandler(tornado.web.RequestHandler):\n @gen.coroutine\n def get(self):\n response = yield gen.Task(tasks.echo.apply_async, args=['Hello world!'])\n self.write(response.result)\n \n \n def main():\n totoro.setup_producer()\n application = tornado.web.Application([\n (r\"/\", MainHandler),\n ])\n http_server = tornado.httpserver.HTTPServer(application)\n http_server.listen(8888)\n tornado.ioloop.IOLoop.instance().start()\n \n \n if __name__ == \"__main__\":\n main()\n\nTo run celery worker for the example:\n\n.. code-block:: bash\n\n $ python -m totoro.test.runtasks worker -l INFO\n\nConfiguration and defaults\n--------------------------\n\nTOTORO_AMQP_CONNECTION_POOL\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n*New in version 0.1.2*\n\nThe setting must a dict that used to configure the AMQP(RabbitMQ) connection pool. It supporting the following keys:\n\n* max_idle_connections - Max number of keeping connections. Defaults to 3.\n* max_open_connections - Max number of opened connections, 0 means no limit. Defaults to 10.\n* max_recycle_sec - How long connections are recycled. Defaults to 3600.\n\nExample configuration:\n\n.. code-block:: python\n\n celery = Celery(\"totoro_celery_tasks\")\n celery.conf.update(\n BROKER_URL='amqp://guest:guest@localhost:5672//',\n CELERY_TASK_SERIALIZER='json',\n CELERY_ACCEPT_CONTENT=['json'], # Ignore other content\n CELERY_RESULT_SERIALIZER='json',\n CELERY_TIMEZONE='Asia/Shanghai',\n CELERY_ENABLE_UTC=True,\n TOTORO_AMQP_CONNECTION_POOL={\n 'max_idle_connections': 1,\n 'max_open_connections': 10,\n 'max_recycle_sec': 3600\n },\n )\n\nTests\n-----\n\nTo run the tests for the AMQP(broker/backend):\n\n.. code-block:: bash\n\n $ python -m totoro.test.runtasks worker -l INFO\n $ python -m totoro.test.runtests\n\nTo run the tests for the AMQP broker with the Redis backend:\n\n.. code-block:: bash\n\n $ CELERY_RESULT_BACKEND=redis://127.0.0.1:6379/0 python -m totoro.test.runtasks worker -l INFO\n $ CELERY_RESULT_BACKEND=redis://127.0.0.1:6379/0 python -m totoro.test.runtests\n\nTo run the tests for the Redis(broker/backend):\n\n.. code-block:: bash\n\n $ BROKER_URL=redis://127.0.0.1:6379/0 CELERY_RESULT_BACKEND=redis://127.0.0.1:6379/0 python -m totoro.test.runtasks worker -l INFO\n $ BROKER_URL=redis://127.0.0.1:6379/0 CELERY_RESULT_BACKEND=redis://127.0.0.1:6379/0 python -m totoro.test.runtests", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Strawhatfy/totoro", "keywords": "tornado,celery,amqp,redis", "license": "http://www.apache.org/licenses/LICENSE-2.0", "maintainer": null, "maintainer_email": null, "name": "totoro", "package_url": "https://pypi.org/project/totoro/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/totoro/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Strawhatfy/totoro" }, "release_url": "https://pypi.org/project/totoro/0.1.3/", "requires_dist": null, "requires_python": null, "summary": "Celery integration with Tornado", "version": "0.1.3" }, "last_serial": 1962686, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "458e5e9d60041185e19e2fbd60932da2", "sha256": "f5d06aed47327af3d656a482c6438121fe08e41b689b1c84d8419c84fd90c95c" }, "downloads": -1, "filename": "totoro-0.1.0-py27-none-any.whl", "has_sig": false, "md5_digest": "458e5e9d60041185e19e2fbd60932da2", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 14006, "upload_time": "2015-12-28T13:22:58", "url": "https://files.pythonhosted.org/packages/e5/2b/461ccdec212a8116f4f62a9e179920f6889b79da55b75e6450063c910f18/totoro-0.1.0-py27-none-any.whl" }, { "comment_text": "", "digests": { "md5": "691e994c1f5b8d8350653f45543caf50", "sha256": "e1db156c1479b9849a4147a6c1e96b0058f5ec9a8eaff72cfbc379317631c4c5" }, "downloads": -1, "filename": "totoro-0.1.0.zip", "has_sig": false, "md5_digest": "691e994c1f5b8d8350653f45543caf50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21185, "upload_time": "2015-12-28T13:22:35", "url": "https://files.pythonhosted.org/packages/dc/02/ad12121b3a732362d916e48fe69664ce5669762d57df44fc20dd3dcd540c/totoro-0.1.0.zip" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "7101810111aa91ef0537ec8125ce91bc", "sha256": "63aebc699e658f1d73a636bbe1dd485d49e9b3c611c147e6f7353290d7aabd81" }, "downloads": -1, "filename": "totoro-0.1.2-py27-none-any.whl", "has_sig": false, "md5_digest": "7101810111aa91ef0537ec8125ce91bc", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 16043, "upload_time": "2016-01-04T10:18:13", "url": "https://files.pythonhosted.org/packages/fd/4c/a012745d7a8e4aec663b741ebee384afddc90472073d8ef2d5a8aac8c3c1/totoro-0.1.2-py27-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0ebebd6841e1b171732e22a0031d7c51", "sha256": "4375876117fff8285943637a1ffe4bf8da40b12aea87fd169c27742663bb7f82" }, "downloads": -1, "filename": "totoro-0.1.2.zip", "has_sig": false, "md5_digest": "0ebebd6841e1b171732e22a0031d7c51", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23945, "upload_time": "2016-01-04T10:19:34", "url": "https://files.pythonhosted.org/packages/26/ba/503f0a0713d718881e4b1a2e162c6dfba2a4792d047eec3a3c23ce517b15/totoro-0.1.2.zip" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "575848f74f33db0cdbbe8b7ec0b5efa2", "sha256": "56d2967f26df930f1fe8a08021213a2880cefcacc4d046b375a13482860ed210" }, "downloads": -1, "filename": "totoro-0.1.3-py27-none-any.whl", "has_sig": false, "md5_digest": "575848f74f33db0cdbbe8b7ec0b5efa2", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 16196, "upload_time": "2016-02-18T06:39:14", "url": "https://files.pythonhosted.org/packages/b6/bf/4dd368efe73606be5ecd8e2d1fbbca40a7e8679ae04e4d02dd12fd6e4eaf/totoro-0.1.3-py27-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d4ae6e531b352c6e8762dab3be8eca0a", "sha256": "219e33d694eaf452d6153027b31a069e0036a34554c3ee792a0a060ea324aa09" }, "downloads": -1, "filename": "totoro-0.1.3.zip", "has_sig": false, "md5_digest": "d4ae6e531b352c6e8762dab3be8eca0a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24065, "upload_time": "2016-02-18T06:38:15", "url": "https://files.pythonhosted.org/packages/00/5b/9f0f159bbe09512682b2b1954e5da11507a158ec0d87c44ff8386efc704c/totoro-0.1.3.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "575848f74f33db0cdbbe8b7ec0b5efa2", "sha256": "56d2967f26df930f1fe8a08021213a2880cefcacc4d046b375a13482860ed210" }, "downloads": -1, "filename": "totoro-0.1.3-py27-none-any.whl", "has_sig": false, "md5_digest": "575848f74f33db0cdbbe8b7ec0b5efa2", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 16196, "upload_time": "2016-02-18T06:39:14", "url": "https://files.pythonhosted.org/packages/b6/bf/4dd368efe73606be5ecd8e2d1fbbca40a7e8679ae04e4d02dd12fd6e4eaf/totoro-0.1.3-py27-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d4ae6e531b352c6e8762dab3be8eca0a", "sha256": "219e33d694eaf452d6153027b31a069e0036a34554c3ee792a0a060ea324aa09" }, "downloads": -1, "filename": "totoro-0.1.3.zip", "has_sig": false, "md5_digest": "d4ae6e531b352c6e8762dab3be8eca0a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24065, "upload_time": "2016-02-18T06:38:15", "url": "https://files.pythonhosted.org/packages/00/5b/9f0f159bbe09512682b2b1954e5da11507a158ec0d87c44ff8386efc704c/totoro-0.1.3.zip" } ] }