{ "info": { "author": "Laisky", "author_email": "ppcelery@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries" ], "description": "Ramjet\n===\n\n[![versions](https://img.shields.io/badge/version-v1.8.1-blue.svg)]()\n[![PyPI version](https://badge.fury.io/py/ramjet.svg)](https://badge.fury.io/py/ramjet)\n[![versions](https://img.shields.io/badge/license-MIT/Apache-blue.svg)]()\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\n> \u308f\u304c\u5f81\u304f\u306f\u661f\u306e\u5927\u6d77 \u2014\u2014 Yang Wen-li\n\n| ![](http://7xjvpy.dl1.z0.glb.clouddn.com/ramjet.jpg) |\n|:--:|\n| \u540e\u53f0\u811a\u672c\u7684\u5f15\u64ce |\n\n\n## Links\n\n - [Documents](http://laisky.github.io/ramjet/)\n - [Github](https://github.com/Laisky/ramjet)\n - [PyPI](https://pypi.python.org/pypi/ramjet)\n\n\n## Install & Run\n\nNeed Python3.5.x.\n\n```sh\n# Install from pypi\n\n$ pip install ramjet\n```\n\n```sh\n# Install from source\n\n$ python setup.py install\n$ python -m ramjet [--debug=true]\n```\n\n\n## Description\n\n\u57fa\u4e8e asyncio \u548c consurrent.futures \u8fd0\u884c\u811a\u672c\uff08`tasks`\uff09\u3002\n\n\u6bcf\u4e00\u4e2a task \u90fd\u9700\u8981\u5b9e\u73b0\u63a5\u53e3 `bind_task()`\u3002\n\n\u5229\u7528 `ioloop`\u3001`thread_executor`\u3001`process_executor` \u81ea\u884c\u5b9e\u73b0\u8fd0\u884c\u903b\u8f91\u3002\n\n\n## Demo\n\n### \u5f02\u6b65\n\n```py\nimport random\nimport asyncio\n\nfrom ramjet.engines import process_executor, thread_executor, ioloop\n\n\ndef bind_task():\n # \u5c06\u4efb\u52a1\u6dfb\u52a0\u8fdb\u4e8b\u4ef6\u5faa\u73af\u4e2d\n asyncio.ensure_future(async_task())\n\n\nasync def async_task():\n await asyncio.sleep(3)\n for i in range(10):\n asyncio.ensure_future(async_child_task(i))\n\n\nasync def async_child_task(n):\n await asyncio.sleep(random.random())\n print('child task {} ok!'.format(n))\n\n```\n\n### \u591a\u7ebf\u7a0b & \u591a\u8fdb\u7a0b\n\n\u9700\u8981\u6ce8\u610f\u5b50\u8fdb\u7a0b\u6ca1\u6cd5\u56de\u6536\uff0c\u6240\u4ee5\u8bf7\u786e\u4fdd task \u53ef\u4ee5\u5f88\u597d\u7684\u7ed3\u675f\u3002\n\n```py\nfrom ramjet.engines import process_executor, thread_executor, ioloop\n\n\ndef bind_task():\n # \u591a\u7ebf\u7a0b\n thread_executor.submit(task, your_arguments)\n # \u591a\u8fdb\u7a0b\n process_executor.submit(task, your_arguments)\n\n\ndef task(*args, **kw):\n pass\n\n```\n\n### \u5b9a\u65f6\u4efb\u52a1\n\n```py\nfrom ramjet.engines import process_executor, thread_executor, ioloop\n\n\ndef bind_task():\n delay = 3600\n ioloop.call_later(delay, task, your_auguments)\n\n\ndef task(*args, **kw):\n # \u53ef\u4ee5\u5728 task \u5185\u8bbe\u7f6e\u4e0b\u4e00\u6b21\u6267\u884c\u7684\u65f6\u95f4\n # ioloop.call_later(delay, task, *args, **kw)\n```\n\n### HTTP\n\n```py\nfrom aiohttp import web\n\nfrom ramjet.settings import logger\n\n\nlogger = logger.getChild('tasks.web_demo')\n\n\ndef bind_task():\n logger.info(\"run web_demo\")\n\n\ndef bind_handle(add_route):\n add_route('/', DemoHandle)\n\n\nclass DemoHandle(web.View):\n\n async def get(self):\n return web.Response(text=\"New hope\")\n```\n\n## Versions\n\n[\u66f4\u65b0\u65e5\u5fd7](https://github.com/Laisky/ramjet/blob/master/CHANGELOG.md)\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Laisky/ramjet", "keywords": "aiohttp", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "ramjet", "package_url": "https://pypi.org/project/ramjet/", "platform": "", "project_url": "https://pypi.org/project/ramjet/", "project_urls": { "Homepage": "https://github.com/Laisky/ramjet" }, "release_url": "https://pypi.org/project/ramjet/1.8.1/", "requires_dist": null, "requires_python": "", "summary": "Scripts Manager", "version": "1.8.1" }, "last_serial": 3647153, "releases": { "1.1": [ { "comment_text": "", "digests": { "md5": "b9ce13149538230ee6767e45d6da6a6e", "sha256": "1abfd72f3d8cd075dfc30f062c79a4238791727c6961ca87238de25c2dfbaaed" }, "downloads": -1, "filename": "ramjet-1.1-py3.4.egg", "has_sig": false, "md5_digest": "b9ce13149538230ee6767e45d6da6a6e", "packagetype": "bdist_egg", "python_version": "3.4", "requires_python": null, "size": 18827, "upload_time": "2015-12-28T03:11:38", "url": "https://files.pythonhosted.org/packages/08/07/c986ea06201daac00a21c47dd94cb5e448df02ecdf0a81205af134fc478e/ramjet-1.1-py3.4.egg" }, { "comment_text": "", "digests": { "md5": "08e9f1803a74121eb263b36bacdb08e0", "sha256": "425ba10bc083a5a0a12a3243e8b433763fc79368d1bcf57536205932841c580c" }, "downloads": -1, "filename": "ramjet-1.1.tar.gz", "has_sig": false, "md5_digest": "08e9f1803a74121eb263b36bacdb08e0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5323, "upload_time": "2015-12-28T03:09:54", "url": "https://files.pythonhosted.org/packages/c9/a7/10ad3c36e5dc25b3273cb5d0276410a9f54cb45b432fab9d8c925aca266d/ramjet-1.1.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "723fdbccd28098f32f1cadee61a4e32f", "sha256": "b0ecc64392735af9ee07439b98061341be522738976f4e1cd4dd476d11788333" }, "downloads": -1, "filename": "ramjet-1.1.1-py3.4.egg", "has_sig": false, "md5_digest": "723fdbccd28098f32f1cadee61a4e32f", "packagetype": "bdist_egg", "python_version": "3.4", "requires_python": null, "size": 18969, "upload_time": "2015-12-28T03:19:58", "url": "https://files.pythonhosted.org/packages/97/4f/38a9ae7a3d5fef2a6a136f3c38cd1a1fa8296ce751f8b697223aee7ce4b5/ramjet-1.1.1-py3.4.egg" }, { "comment_text": "", "digests": { "md5": "004a98c94afbee31c5d7e5b3f7e7c993", "sha256": "a057691fb55da4c97ddc1fd19a7188070782a96413addcb96d8e5e5e44758f1e" }, "downloads": -1, "filename": "ramjet-1.1.1.tar.gz", "has_sig": false, "md5_digest": "004a98c94afbee31c5d7e5b3f7e7c993", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5572, "upload_time": "2015-12-28T03:20:34", "url": "https://files.pythonhosted.org/packages/2e/ce/28daa526e41d10522fd4a698499a963a0a7fbb6f86476d56f372d656be72/ramjet-1.1.1.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "241108469a0d729d3e70b9fa7bda5617", "sha256": "43163ddeca5a96ea8b2ebac85285154b72c10f15e7c989f94efdd25de879c85c" }, "downloads": -1, "filename": "ramjet-1.2.1-py3.5.egg", "has_sig": false, "md5_digest": "241108469a0d729d3e70b9fa7bda5617", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 9310, "upload_time": "2016-08-02T01:04:23", "url": "https://files.pythonhosted.org/packages/53/d5/0b1d795b965bb00d4b9bbdbc614871191ee9b3d3f589b4e7e2dd8e55a4dd/ramjet-1.2.1-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "427ca983d6f78dc9df2f74bf68b1c523", "sha256": "33cc8b90c997724a70c568ed892a39da4ce80909fdc2238526d6c75ee065440b" }, "downloads": -1, "filename": "ramjet-1.2.1.tar.gz", "has_sig": false, "md5_digest": "427ca983d6f78dc9df2f74bf68b1c523", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4228, "upload_time": "2016-08-02T01:04:36", "url": "https://files.pythonhosted.org/packages/08/78/7717ff76ed1620a86f3569142275bb9c964832acf17c24cf5675273f50a5/ramjet-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "3935c59081d3340e481700b3d2ae83d7", "sha256": "23bb7f46fe8d403074403540a21c9d48c4139365eb90caf70d851edec6676a53" }, "downloads": -1, "filename": "ramjet-1.2.2-py3.5.egg", "has_sig": false, "md5_digest": "3935c59081d3340e481700b3d2ae83d7", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 9389, "upload_time": "2016-08-02T01:10:48", "url": "https://files.pythonhosted.org/packages/5a/d9/3a075a300d5b122fd17d1b8b6cad473f40299bd3d727e336c81e6831667d/ramjet-1.2.2-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "562552e4c19795e6424650b46a1caddf", "sha256": "d3bea11abced25fd9858d8aa3751911623174231db34cada21173f9ba435ccfe" }, "downloads": -1, "filename": "ramjet-1.2.2.tar.gz", "has_sig": false, "md5_digest": "562552e4c19795e6424650b46a1caddf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4627, "upload_time": "2016-08-02T01:10:36", "url": "https://files.pythonhosted.org/packages/69/6a/9b6b7d374db06b69ca81cff9f5cc50e4ffcce79b84973780524cd6f6a225/ramjet-1.2.2.tar.gz" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "1506c4c477bdcc49ac85f71c920890fe", "sha256": "f9854d06894b4418647beeeb7a1dfe082d1644ad7f00ebd8178c1e3dd91e9e48" }, "downloads": -1, "filename": "ramjet-1.4.tar.gz", "has_sig": false, "md5_digest": "1506c4c477bdcc49ac85f71c920890fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4036, "upload_time": "2016-10-11T02:34:34", "url": "https://files.pythonhosted.org/packages/26/cb/9e9c25417c625a14f0edec68a38997fbb42dd4a2023ccf1bf6ea73cea29f/ramjet-1.4.tar.gz" } ], "1.5": [ { "comment_text": "", "digests": { "md5": "94d2c884a54f32177a303668e7d4a271", "sha256": "4f66e265db13ea22edcb14b91f81eb6479cb728a96d9d548bfd93ac059f46f7d" }, "downloads": -1, "filename": "ramjet-1.5.tar.gz", "has_sig": false, "md5_digest": "94d2c884a54f32177a303668e7d4a271", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4295, "upload_time": "2017-01-22T05:22:28", "url": "https://files.pythonhosted.org/packages/9c/32/4899bbd6cb35d7806a594b18b670999701a0275fe776c71aed7e8ef46512/ramjet-1.5.tar.gz" } ], "1.8.1": [ { "comment_text": "", "digests": { "md5": "c8af36b63de19d6a72488aa1d03b8ecd", "sha256": "9168bcae7448a9b1e308084abe7e23090d19fac5d2947ce2a20ef0f0645735b9" }, "downloads": -1, "filename": "ramjet-1.8.1-py3.6.egg", "has_sig": false, "md5_digest": "c8af36b63de19d6a72488aa1d03b8ecd", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 70598, "upload_time": "2018-03-07T10:04:47", "url": "https://files.pythonhosted.org/packages/58/1a/d5ca9a29183975e8e18296deffed80f7617015ba8aafa8aaf492d65b4a4a/ramjet-1.8.1-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "8c68c1d7b7f45de701bf78d7ebcf00cc", "sha256": "3e7dab16da1d13e8a2f70c12206999ddb6d6d8a5b8f36629940c64928fe9f063" }, "downloads": -1, "filename": "ramjet-1.8.1.tar.gz", "has_sig": false, "md5_digest": "8c68c1d7b7f45de701bf78d7ebcf00cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24155, "upload_time": "2018-03-07T10:04:38", "url": "https://files.pythonhosted.org/packages/4e/ad/d11531eb994262230205be9cba113872f51d2c5022c3b8cede5fa4c90551/ramjet-1.8.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c8af36b63de19d6a72488aa1d03b8ecd", "sha256": "9168bcae7448a9b1e308084abe7e23090d19fac5d2947ce2a20ef0f0645735b9" }, "downloads": -1, "filename": "ramjet-1.8.1-py3.6.egg", "has_sig": false, "md5_digest": "c8af36b63de19d6a72488aa1d03b8ecd", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 70598, "upload_time": "2018-03-07T10:04:47", "url": "https://files.pythonhosted.org/packages/58/1a/d5ca9a29183975e8e18296deffed80f7617015ba8aafa8aaf492d65b4a4a/ramjet-1.8.1-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "8c68c1d7b7f45de701bf78d7ebcf00cc", "sha256": "3e7dab16da1d13e8a2f70c12206999ddb6d6d8a5b8f36629940c64928fe9f063" }, "downloads": -1, "filename": "ramjet-1.8.1.tar.gz", "has_sig": false, "md5_digest": "8c68c1d7b7f45de701bf78d7ebcf00cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24155, "upload_time": "2018-03-07T10:04:38", "url": "https://files.pythonhosted.org/packages/4e/ad/d11531eb994262230205be9cba113872f51d2c5022c3b8cede5fa4c90551/ramjet-1.8.1.tar.gz" } ] }