{ "info": { "author": "Raymond Wu", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "Module burncpu is a worker dispatcher with multiprocessing and multithreading.\n\nFeatures\n========\n- All CPU cores can be used.\n- Workers can be stopped gracefully by system signals.\n- Pure python code.\n\nQuickstart\n==========\nUse the following command to run the sample module.\n\n.. code:: bash\n\n python3 -m burncpu.sample\n\nThen monitor CPU status, some changes take place at these time.\n\n==== =================================================\nTime Events\n==== =================================================\n 0s All CPU cores are IDLE.\n 10s Workers begin to call one_second_task many times.\n 60s Workers begin to terminate.\n==== =================================================\n\nPressing Ctrl+C or sending system signal can also terminate the sample.\n\nFinally copy and modify the `source code `_ to make your own.\n\nReference\n=========\n\nTo import\n---------\n\n.. code:: python\n\n from burncpu.dispatcher import WorkerDispatcher\n\nclass WorkerDispatcher\n----------------------\n\nWorkerDispatcher.__init__(worker_count=0, use_core=0, time_limit=0)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nCreate a dispatcher instace.\n\nworker_count\n How many threads would be created, 0 means to create (use_core * 2) threads.\nuse_core\n How many cores would be use, 0 means all cores.\ntime_limit\n Stop workers after given seconds. Running functions still run at that moment.\n Queued functions would be cancled.\n\nWorkerDispatcher.dispatch(func, args)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nDispatch a function to one of workers randomly.\n\nfunc\n Function to call.\nargs\n Argument list of this function.\n\nWorkerDispatcher.sleep(seconds)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nSleep dispatcher for given seconds.\n\nseconds\n Seconds to sleep. Dispatcher would not sleep given seconds actually.\n It sleep many times during given seconds, so that system signal (e.g. Ctrl+C) can be handled.\n\nWorkerDispatcher.join()\n^^^^^^^^^^^^^^^^^^^^^^^\n\nWait until all workers stopped.\n\nWorkerDispatcher.is_alive()\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nCheck if the dispatcher is alive.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/virus-warnning/burncpu", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "burncpu", "package_url": "https://pypi.org/project/burncpu/", "platform": "", "project_url": "https://pypi.org/project/burncpu/", "project_urls": { "Homepage": "https://github.com/virus-warnning/burncpu" }, "release_url": "https://pypi.org/project/burncpu/0.0.16/", "requires_dist": null, "requires_python": ">=3.6", "summary": "A worker dispatcher with multiprocessing and multithreading.", "version": "0.0.16" }, "last_serial": 3685028, "releases": { "0.0.15": [ { "comment_text": "", "digests": { "md5": "6b2383f6c0a56a46ccb01c434b8659e0", "sha256": "7cb0ce291d877cc1284a980a32c0acf94e06b3e077c3877689da5bd7aaa53bfa" }, "downloads": -1, "filename": "burncpu-0.0.15-py3-none-any.whl", "has_sig": false, "md5_digest": "6b2383f6c0a56a46ccb01c434b8659e0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 3442, "upload_time": "2018-03-19T18:31:07", "url": "https://files.pythonhosted.org/packages/58/71/12d9c07dd770c47c43fcca45de93bef494a31bae18c709dd73cd6a4cf70f/burncpu-0.0.15-py3-none-any.whl" } ], "0.0.16": [ { "comment_text": "", "digests": { "md5": "c66fe30a6cdc688e604e8a2ce69a8df7", "sha256": "cf38333a1fd4668cafbeca017ca3e472f01053446e1a1607294d23b9642fc2b9" }, "downloads": -1, "filename": "burncpu-0.0.16-py3-none-any.whl", "has_sig": false, "md5_digest": "c66fe30a6cdc688e604e8a2ce69a8df7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 3497, "upload_time": "2018-03-19T18:42:25", "url": "https://files.pythonhosted.org/packages/3c/d6/c49501e900c1b39c39fd5b56f9afbce685a9c83aae05b36161ab18140515/burncpu-0.0.16-py3-none-any.whl" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "07720c9eef03c36946dcbe72a1a4ecd3", "sha256": "6327f293dc354bb73ca41eaa2ee8456b80925f37b0ff9e5ad9782e39cace1920" }, "downloads": -1, "filename": "burncpu-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "07720c9eef03c36946dcbe72a1a4ecd3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 1835, "upload_time": "2018-03-19T07:12:21", "url": "https://files.pythonhosted.org/packages/64/7e/50e7aa686f361e0fd337f3a692d2b362ca7f8c8c69fcae59590a158405d2/burncpu-0.0.4-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c66fe30a6cdc688e604e8a2ce69a8df7", "sha256": "cf38333a1fd4668cafbeca017ca3e472f01053446e1a1607294d23b9642fc2b9" }, "downloads": -1, "filename": "burncpu-0.0.16-py3-none-any.whl", "has_sig": false, "md5_digest": "c66fe30a6cdc688e604e8a2ce69a8df7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 3497, "upload_time": "2018-03-19T18:42:25", "url": "https://files.pythonhosted.org/packages/3c/d6/c49501e900c1b39c39fd5b56f9afbce685a9c83aae05b36161ab18140515/burncpu-0.0.16-py3-none-any.whl" } ] }