{ "info": { "author": "MG", "author_email": "mmmaaaggg@163.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: No Input/Output (Daemon)", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: Chinese (Simplified)", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development" ], "description": "# ProducerConsumerPattern\n[![Build Status](https://travis-ci.org/mmmaaaggg/ProducerConsumerPattern.svg?branch=master)](https://travis-ci.org/mmmaaaggg/ProducerConsumerPattern)\n\n\u901a\u8fc7\u88c5\u9970\u5668\u65b9\u5f0f\u5b9e\u73b0\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u5f0f\u3002\n\u53ef\u4ee5\u4f5c\u7528\u4e8e\u51fd\u6570\u3001\u7c7b\u7684\u65b9\u6cd5\u4e0a\uff0c\u4f7f\u5176\u53d8\u4e3a\u5f02\u6b65\u8c03\u7528\uff0c\u540c\u65f6\uff0c\u8f6c\u53d8\u4e3a\u9010\u6b21\u8c03\u7528\uff0c\u6279\u91cf\u6267\u884c\u3002\u65b9\u4fbf\u5c06\u96f6\u788e\u7684\u8c03\u7528\u8f6c\u53d8\u4e3a\u6279\u91cf\u5f62\u52bf\u8fdb\u884c\u7edf\u4e00\u6267\u884c\u3002\n\n[Github \u5730\u5740\uff1aProducerConsumerPattern](https://github.com/mmmaaaggg/ProducerConsumerPattern)\n\n### \u5b89\u88c5\n> pip install prodconpattern\n\n### \u793a\u4f8b\u4ee3\u7801\n\n\u51fd\u6570\u8c03\u7528\uff1a\u9010\u6b21\u8c03\u7528 -> \u5f02\u6b65\u9010\u6b21\u8c03\u7528\n```python\nfrom prodconpattern import ProducerConsumer\n\n@ProducerConsumer(threshold=3)\ndef method_single_invoke(n):\n \"\"\"\u51fd\u6570\u8c03\u7528\uff1a\u9010\u6b21\u8c03\u7528 -> \u5f02\u6b65\u9010\u6b21\u8c03\u7528\"\"\"\n print('method_single_invoke ->', n)\n\nimport time\n\n# \u51fd\u6570\u8c03\u7528\uff1a\u9010\u6b21\u8c03\u7528 -> \u5f02\u6b65\u9010\u6b21\u8c03\u7528\nfor n in range(10):\n print(\"call -> method_single_invoke(%d)\" % n)\n method_single_invoke(n)\n\ntime.sleep(6)\n```\n\n\u51fd\u6570\u8c03\u7528\uff1a\u9010\u6b21\u8c03\u7528 -> \u5f02\u6b65\u6279\u91cf\u8c03\u7528\n```python\nfrom prodconpattern import ProducerConsumer\n\n@ProducerConsumer(threshold=3, pass_arg_list=True)\ndef method_list_invoke(n):\n \"\"\"\u51fd\u6570\u8c03\u7528\uff1a\u9010\u6b21\u8c03\u7528 -> \u5f02\u6b65\u6279\u91cf\u8c03\u7528\"\"\"\n print('method_list_invoke ->', n)\n\nimport time\n\n# \u51fd\u6570\u8c03\u7528\uff1a\u9010\u6b21\u8c03\u7528 -> \u5f02\u6b65\u6279\u91cf\u8c03\u7528\nfor n in range(10):\n # time.sleep(1)\n print(\"call -> method_list_invoke(%d)\" % n)\n method_list_invoke(n)\n\ntime.sleep(6)\n```\n\n\u5bf9\u8c61\u65b9\u6cd5\u8c03\u7528\uff1a\u9010\u6b21\u8c03\u7528 -> \u5f02\u6b65\u6279\u91cf\u8c03\u7528\n```python\nfrom prodconpattern import ProducerConsumer\n\nclass AClass:\n\n @ProducerConsumer(threshold=3, pass_arg_list=True, is_class_method=True)\n def class_method_list_invoke(self, n):\n \"\"\"\u5bf9\u8c61\u65b9\u6cd5\u8c03\u7528\uff1a\u9010\u6b21\u8c03\u7528 -> \u5f02\u6b65\u6279\u91cf\u8c03\u7528\"\"\"\n print(self.__class__.__name__, \"print_method\", n)\n\nimport time\n\n# \u5bf9\u8c61\u65b9\u6cd5\u8c03\u7528\uff1a\u9010\u6b21\u8c03\u7528 -> \u5f02\u6b65\u6279\u91cf\u8c03\u7528\naaa = AClass()\nfor n in range(10):\n print(\"call -> class_method_list_invoke(%d)\" % n)\n aaa.class_method_list_invoke(n)\n\ntime.sleep(6)\n```\n\n\u66f4\u591a\u4f8b\u5b50\u53c2\u8003\n[example.py \u6587\u4ef6](https://github.com/mmmaaaggg/ProducerConsumerPattern/blob/master/example.py)\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mmmaaaggg/ProducerConsumerPattern", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "prodconpattern", "package_url": "https://pypi.org/project/prodconpattern/", "platform": "", "project_url": "https://pypi.org/project/prodconpattern/", "project_urls": { "Homepage": "https://github.com/mmmaaaggg/ProducerConsumerPattern" }, "release_url": "https://pypi.org/project/prodconpattern/0.2.1/", "requires_dist": null, "requires_python": ">=3.4", "summary": "\u901a\u8fc7\u88c5\u9970\u5668\u65b9\u5f0f\u5b9e\u73b0\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u5f0f\u3002\u53ef\u4ee5\u4f5c\u7528\u4e8e\u51fd\u6570\u3001\u7c7b\u7684\u65b9\u6cd5\u4e0a\uff0c\u4f7f\u5176\u53d8\u4e3a\u5f02\u6b65\u8c03\u7528\uff0c\u540c\u65f6\uff0c\u8f6c\u53d8\u4e3a\u9010\u6b21\u8c03\u7528\uff0c\u6279\u91cf\u6267\u884c\u3002\u65b9\u4fbf\u5c06\u96f6\u788e\u7684\u8c03\u7528\u8f6c\u53d8\u4e3a\u6279\u91cf\u5f62\u52bf\u8fdb\u884c\u7edf\u4e00\u6267\u884c\u3002", "version": "0.2.1" }, "last_serial": 4558805, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "0f92dd43a9373108fc1f84e607b08ad3", "sha256": "577de412515d3ff7427aee55d128d480b41a3003f53f669a4c6af013de3fe197" }, "downloads": -1, "filename": "prodconpattern-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0f92dd43a9373108fc1f84e607b08ad3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3749, "upload_time": "2018-06-15T00:40:10", "url": "https://files.pythonhosted.org/packages/bd/bb/f4098c2dd03a6d2ace8120760de4cde76efded59971455b73a7fa3ec0bf6/prodconpattern-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b823b9aedd4dbfa559370de63c26fab7", "sha256": "2e4d093a8cb840064a447f862724f5fe7af804de321851206a06c7274293a7a7" }, "downloads": -1, "filename": "prodconpattern-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b823b9aedd4dbfa559370de63c26fab7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3434, "upload_time": "2018-06-15T00:40:13", "url": "https://files.pythonhosted.org/packages/de/b2/4ab16918eb38cf4d6caa9aa8627fcb25912da8d93ea2fa07a0c69ca8f64c/prodconpattern-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "f4e14a71359e09609e4a5c649de2ad8e", "sha256": "9fcdc7c89553016c2f7a1afe34aa6fbadfd4293bb6dc2f633cb43a1ec29ede17" }, "downloads": -1, "filename": "prodconpattern-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f4e14a71359e09609e4a5c649de2ad8e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 3801, "upload_time": "2018-06-15T01:04:38", "url": "https://files.pythonhosted.org/packages/bd/79/ddd200df525fd9dac3a90044d790ca18e2981344cc7d382721aa323c1dc9/prodconpattern-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e0e182722e2650895389d9a7d395f239", "sha256": "f360adf7011a394db44cb99e283314d23d5ef688ceb67c3fc9b5c5f808bd2259" }, "downloads": -1, "filename": "prodconpattern-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e0e182722e2650895389d9a7d395f239", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 3505, "upload_time": "2018-06-15T01:04:40", "url": "https://files.pythonhosted.org/packages/32/97/9f13a037b590789edcdcd97aab255d124ec56f2c271f96321e733ed30e76/prodconpattern-0.1.1.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "704195f5733402ec2ae98a86a42dd71a", "sha256": "42d75a079bb558a1b54084cdba367af7ca94c5a26b1f236d4f6e94d073aadd37" }, "downloads": -1, "filename": "prodconpattern-0.1.9-py3.5.egg", "has_sig": false, "md5_digest": "704195f5733402ec2ae98a86a42dd71a", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 4788, "upload_time": "2018-06-15T00:40:14", "url": "https://files.pythonhosted.org/packages/18/c0/0d65132d43c8d4b53997f12c39d013a68633c04b05bdd6ec5593ec23e17d/prodconpattern-0.1.9-py3.5.egg" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "26b6f330ed5a9c107219b4fd479f8475", "sha256": "0d9be2482ce1714eb26d89b8894f419bb96c66477e964aed6461323ae87a0f00" }, "downloads": -1, "filename": "prodconpattern-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "26b6f330ed5a9c107219b4fd479f8475", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 4971, "upload_time": "2018-06-16T09:15:13", "url": "https://files.pythonhosted.org/packages/2e/0c/f103721c821eab182d2607fece4b79e0e7e746d736144d8cf502eeac026d/prodconpattern-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e5e03c522469b7d4a7636c86f480c664", "sha256": "c89934eb6afbe4b73db30c3c29063b7283a61bff1d0e63156b953643833dba50" }, "downloads": -1, "filename": "prodconpattern-0.2.0.tar.gz", "has_sig": false, "md5_digest": "e5e03c522469b7d4a7636c86f480c664", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 3965, "upload_time": "2018-06-16T09:15:15", "url": "https://files.pythonhosted.org/packages/f2/1f/9379b3fb26232e435566701c0cbca675860ac1ac0e16ca4aab85c5493796/prodconpattern-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "66f6898fb1f49fb65347e62ec7b993ce", "sha256": "21fa2923b29decc739de23f3e4319ad6e7d2345e9eb6449beb7049bf66f7cc09" }, "downloads": -1, "filename": "prodconpattern-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "66f6898fb1f49fb65347e62ec7b993ce", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 4968, "upload_time": "2018-12-04T08:58:05", "url": "https://files.pythonhosted.org/packages/2a/db/332c2b9c841f38913f784ad651b7c1216c32326267bb6813f2554bf5ef9b/prodconpattern-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4ea5a8f96b99e626822afdb0e733cf68", "sha256": "0422299795b0bd3377c75fd362fe5616837fc0cd85857444c8955c734386ef1b" }, "downloads": -1, "filename": "prodconpattern-0.2.1.tar.gz", "has_sig": false, "md5_digest": "4ea5a8f96b99e626822afdb0e733cf68", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 3972, "upload_time": "2018-12-04T08:58:07", "url": "https://files.pythonhosted.org/packages/e7/c7/f312cde19fbb505e9a8087d8f340b86a874946a2de9b8de406257d149816/prodconpattern-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "66f6898fb1f49fb65347e62ec7b993ce", "sha256": "21fa2923b29decc739de23f3e4319ad6e7d2345e9eb6449beb7049bf66f7cc09" }, "downloads": -1, "filename": "prodconpattern-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "66f6898fb1f49fb65347e62ec7b993ce", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 4968, "upload_time": "2018-12-04T08:58:05", "url": "https://files.pythonhosted.org/packages/2a/db/332c2b9c841f38913f784ad651b7c1216c32326267bb6813f2554bf5ef9b/prodconpattern-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4ea5a8f96b99e626822afdb0e733cf68", "sha256": "0422299795b0bd3377c75fd362fe5616837fc0cd85857444c8955c734386ef1b" }, "downloads": -1, "filename": "prodconpattern-0.2.1.tar.gz", "has_sig": false, "md5_digest": "4ea5a8f96b99e626822afdb0e733cf68", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 3972, "upload_time": "2018-12-04T08:58:07", "url": "https://files.pythonhosted.org/packages/e7/c7/f312cde19fbb505e9a8087d8f340b86a874946a2de9b8de406257d149816/prodconpattern-0.2.1.tar.gz" } ] }