{ "info": { "author": "The Munshi Group", "author_email": "support@munshigroup.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "[![Build Status](https://travis-ci.org/munshigroup/kthread.svg?branch=master)](https://travis-ci.org/munshigroup/kthread)\r\n\r\n# kthread\r\nKillable threads in Python! \r\n\r\n## Purpose\r\nThe built-in `threading.Thread` class offers no simple solution to terminate a running thread. `kthread.KThread` inherits `threading.Thread` and supplies methods named `exit()`, `kill()`, and `terminate()` that serve the same purpose: attempt to stop a thread if it's running.\r\n\r\n## How it works\r\nKThread leverages the CPython API to raise a `SystemExit` exception on a given thread. Assuming that the thread is not blocked by an operating system call (such as `sleep`, `accept`, or `recv`), the thread will forcefully quit.\r\n\r\n## DISCLAIMER\r\n**TERMINATING THREADS MAY INTRODUCE INSTABILITY OR OTHER UNDESIRABLE EFFECTS IN YOUR PROGRAMS. THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY. THE MUNSHI GROUP CANNOT BE HELD LIABLE FOR ANY DAMAGES, LOSSES, OR EXPENSES INCURRED BY YOU OR YOUR ORGANIZATION WHILE USING THIS SOFTWARE.**\r\n\r\n## Installation\r\nTo install this package, run the following command:\r\n\r\n $ pip install kthread\r\n\r\n## Usage\r\n\r\n >>> import time\r\n >>> import kthread\r\n >>> import sys\r\n >>> def func():\r\n >>> try:\r\n >>> while True:\r\n >>> time.sleep(0.2)\r\n >>> finally:\r\n >>> sys.stdout.write(\"Greetings from Vice City!\\n\")\r\n >>> sys.stdout.flush()\r\n >>>\r\n >>> t = kthread.KThread(target = func, name = \"KillableThread1\")\r\n >>> t.start()\r\n >>> t.isAlive()\r\n True\r\n >>> t.terminate()\r\n Greetings from Vice City!\r\n >>> t.isAlive()\r\n False\r\n\r\n## License\r\nMIT\r\n\r\n\r\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/munshigroup/kthread", "keywords": "threading threads terminate", "license": "", "maintainer": "", "maintainer_email": "", "name": "kthread", "package_url": "https://pypi.org/project/kthread/", "platform": "", "project_url": "https://pypi.org/project/kthread/", "project_urls": { "Homepage": "https://github.com/munshigroup/kthread" }, "release_url": "https://pypi.org/project/kthread/0.2.2/", "requires_dist": null, "requires_python": "", "summary": "Killable threads in Python!", "version": "0.2.2" }, "last_serial": 4897178, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "dd0e8932ddcb56765b224aae0a170f3c", "sha256": "0c16318ba9be0e0aeb0441a1331d6cd19a3b206ff6c017197addaa86ae2aab41" }, "downloads": -1, "filename": "kthread-0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "dd0e8932ddcb56765b224aae0a170f3c", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 3176, "upload_time": "2019-01-11T00:47:26", "url": "https://files.pythonhosted.org/packages/0a/dc/49bd479b1e1c3071d14b2c52702eedce5226f65df7610fb701dee5b0df18/kthread-0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0fa4f7051b595feda98faf2005d4b00d", "sha256": "73a6fd4f346f13460751c1fe935c99402ca6646345476649bd1ae31427539dec" }, "downloads": -1, "filename": "kthread-0.1.tar.gz", "has_sig": false, "md5_digest": "0fa4f7051b595feda98faf2005d4b00d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2081, "upload_time": "2019-01-11T00:47:27", "url": "https://files.pythonhosted.org/packages/2e/dd/d9993ef42b6bdd3a3eefe69671bfcd08c771201a173962f8b6611de90f3f/kthread-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "78b9f8126dca9c18eb7ee5b479cd69ea", "sha256": "f89340300bf0046b2c320678df152cd30fa765d0fbfc039e7eb6a1db8dd632aa" }, "downloads": -1, "filename": "kthread-0.1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "78b9f8126dca9c18eb7ee5b479cd69ea", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 3289, "upload_time": "2019-01-23T18:59:23", "url": "https://files.pythonhosted.org/packages/6c/9c/4152a1339b17ffb1c54c2f9420e53a4a87e278e3b6d6796301bcb5ad8877/kthread-0.1.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "19764eae74fda0f1401a3e717728a54a", "sha256": "8b0402f5b29d18a1c38d48de595c5ec01490a67cb1ff327cef153583d6b576d3" }, "downloads": -1, "filename": "kthread-0.1.1.tar.gz", "has_sig": false, "md5_digest": "19764eae74fda0f1401a3e717728a54a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2187, "upload_time": "2019-01-23T18:59:25", "url": "https://files.pythonhosted.org/packages/aa/91/14cf7dee7188db4dfe1270737bff69bc81b532d8ab75c5e4098a8d5ae1a7/kthread-0.1.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "8eca85e23ac2fec1c55a14d88d3ecbe8", "sha256": "6e5b4a1664bd0123b754b05f765c3d65712199323d94fe4f2a6f2e5036f0a13c" }, "downloads": -1, "filename": "kthread-0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "8eca85e23ac2fec1c55a14d88d3ecbe8", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 3273, "upload_time": "2019-02-20T20:30:52", "url": "https://files.pythonhosted.org/packages/08/20/7022abc9536a3f9f19b8921c577015d230cf91a161117c0c1bfe305f6962/kthread-0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "502f934a34686aa3fbf8b789b2fdb32b", "sha256": "9c298fc14a45b1fb8562fc9a096904c46fb24c33057cecc7e460a181f9b477fb" }, "downloads": -1, "filename": "kthread-0.2.tar.gz", "has_sig": false, "md5_digest": "502f934a34686aa3fbf8b789b2fdb32b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2183, "upload_time": "2019-02-20T20:30:53", "url": "https://files.pythonhosted.org/packages/65/18/ad641174da6f7147741abcac9c146e0e433ea3b7c09a0d7fbe34a5681fba/kthread-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "b9dc57d38a55c103229b1e77146488c8", "sha256": "ed6c5d72d202a8bc72965c7604c5759afacc659b6978f8057c744431eb764ff5" }, "downloads": -1, "filename": "kthread-0.2.1-py2-none-any.whl", "has_sig": false, "md5_digest": "b9dc57d38a55c103229b1e77146488c8", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 3788, "upload_time": "2019-03-04T23:24:45", "url": "https://files.pythonhosted.org/packages/3a/1b/651518de47a66a90d692c99f961ebab913c3f3b17dd7549a6d007ecfa9c5/kthread-0.2.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3c1b49c1770a425a2cd8ca65a185210e", "sha256": "ee425dc9a1cdd06929db8385208fcf922dbfe2c8e21eeda7978fd188167cd931" }, "downloads": -1, "filename": "kthread-0.2.1.tar.gz", "has_sig": false, "md5_digest": "3c1b49c1770a425a2cd8ca65a185210e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2867, "upload_time": "2019-03-04T23:24:46", "url": "https://files.pythonhosted.org/packages/7c/f6/ea9d30f729c22a9f5d91045ab4bbefb6fa1398f0913f2617eab2ef1d223a/kthread-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "d7221d395c8fb8061308f8b9021653c5", "sha256": "c89b7506afb28fc2225a4002a239e6e8830c9eac7fc39a54a54ac63edf06b529" }, "downloads": -1, "filename": "kthread-0.2.2-py2-none-any.whl", "has_sig": false, "md5_digest": "d7221d395c8fb8061308f8b9021653c5", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 3893, "upload_time": "2019-03-05T03:04:35", "url": "https://files.pythonhosted.org/packages/0d/78/923c148952774aaab08340d69ea2bd60a2dec0c58db4f51c5bc095b1236e/kthread-0.2.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5218d687f20d9c158c2cbcda5e73a16d", "sha256": "9fb0e4e987854732333e9a15009442e79d665a667a9d24d30460acac0ccb2c8d" }, "downloads": -1, "filename": "kthread-0.2.2.tar.gz", "has_sig": false, "md5_digest": "5218d687f20d9c158c2cbcda5e73a16d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2983, "upload_time": "2019-03-05T03:04:36", "url": "https://files.pythonhosted.org/packages/cc/32/cf425dc4622888376ddac4ee8105bd4a90b18a291a69c63d7bb702cb79bd/kthread-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d7221d395c8fb8061308f8b9021653c5", "sha256": "c89b7506afb28fc2225a4002a239e6e8830c9eac7fc39a54a54ac63edf06b529" }, "downloads": -1, "filename": "kthread-0.2.2-py2-none-any.whl", "has_sig": false, "md5_digest": "d7221d395c8fb8061308f8b9021653c5", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 3893, "upload_time": "2019-03-05T03:04:35", "url": "https://files.pythonhosted.org/packages/0d/78/923c148952774aaab08340d69ea2bd60a2dec0c58db4f51c5bc095b1236e/kthread-0.2.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5218d687f20d9c158c2cbcda5e73a16d", "sha256": "9fb0e4e987854732333e9a15009442e79d665a667a9d24d30460acac0ccb2c8d" }, "downloads": -1, "filename": "kthread-0.2.2.tar.gz", "has_sig": false, "md5_digest": "5218d687f20d9c158c2cbcda5e73a16d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2983, "upload_time": "2019-03-05T03:04:36", "url": "https://files.pythonhosted.org/packages/cc/32/cf425dc4622888376ddac4ee8105bd4a90b18a291a69c63d7bb702cb79bd/kthread-0.2.2.tar.gz" } ] }