{ "info": { "author": "amos402", "author_email": "amos_402@msn.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: C++", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only" ], "description": "`\u4e2d\u6587 `__\n=======================\n\nCheck function with timeout for tracing or handle it\n====================================================\n\nFeature\n=======\n\n- Check a function call is timeout or not.\n- The timeout callback and function call are on the same thread.\n- Multi-thread support. Nest call support.\n\nUsage\n=====\n\n.. code:: python\n\n def on_timeout(start_time: float):\n \"\"\"\n :param start_time: \n \"\"\"\n traceback.print_stack()\n pdb.set_trace()\n raise Exception(\"time_out\")\n\n # time unit is millisecond\n @pymonitor.check_time(10, on_timeout)\n def function_1():\n pass\n\n def function_2():\n with pymonitor.check_context(20, on_timeout):\n # do something\n with pymonitor.check_context(10, on_timeout):\n # do something\n\nImplementation Comparison\n=========================\n\nHere are some comparisons of the other implementations.\n\n- Use ``signal`` module and emit a signal\n\n - Only works in main thread.\n - Not good for nest call becauseof one signal correspond one\n handler.\n If you need nest support you need to enter the timeout function\n continually\n and call ``alarm``. The cost depend on your accuracy.\n - Support Linux only.\n\n- Start new thread for work and join it with a time, if it had timeout,\n handle with it (eg. terminate it)\n\n - Can\u2019t inject the function call.\n - Overhead from threading.\n\n- Use ``sys.settrace`` keep tracing for each\n\n - A huge cost for that.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/amos402/py-xtimeout", "keywords": "timeout", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "xtimeout", "package_url": "https://pypi.org/project/xtimeout/", "platform": "", "project_url": "https://pypi.org/project/xtimeout/", "project_urls": { "Homepage": "https://github.com/amos402/py-xtimeout" }, "release_url": "https://pypi.org/project/xtimeout/0.3.1/", "requires_dist": null, "requires_python": "", "summary": "Trace a timeout function call and handle with it", "version": "0.3.1" }, "last_serial": 4518893, "releases": { "0.1.0.1": [ { "comment_text": "", "digests": { "md5": "4527b70c6956a87b93a53e72226c4bf9", "sha256": "8c4233100182c16895496b227f178022ee94eedf4153908b69a1ad4d8d04f180" }, "downloads": -1, "filename": "xtimeout-0.1.0.1.tar.gz", "has_sig": false, "md5_digest": "4527b70c6956a87b93a53e72226c4bf9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6031, "upload_time": "2018-04-22T15:24:18", "url": "https://files.pythonhosted.org/packages/d7/e0/8c873f5e81c1b42b79d71012d19196a1c78ea0582204f7957d218cd37ad0/xtimeout-0.1.0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "5da938c82e6e1cc0b632627de99725c6", "sha256": "db0e7dd81d2291ba77eae1ebe2ce100582cd7c4af66ca2773f0c1b871921cfdc" }, "downloads": -1, "filename": "xtimeout-0.1.1-cp36-cp36m-win32.whl", "has_sig": false, "md5_digest": "5da938c82e6e1cc0b632627de99725c6", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 18845, "upload_time": "2018-04-22T17:03:14", "url": "https://files.pythonhosted.org/packages/e9/f2/cff304b0c4e5a5b7f76840ee4e978ae6c7ef54a14e9bc7634392ee119e88/xtimeout-0.1.1-cp36-cp36m-win32.whl" }, { "comment_text": "", "digests": { "md5": "50a25bcd261f6944d67cc008d5847582", "sha256": "9265f3749e174eecc3722642fc83de9f401e32faf6c28405e1135330cba1995c" }, "downloads": -1, "filename": "xtimeout-0.1.1.tar.gz", "has_sig": false, "md5_digest": "50a25bcd261f6944d67cc008d5847582", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7102, "upload_time": "2018-04-22T17:03:17", "url": "https://files.pythonhosted.org/packages/05/84/222299f7279062fb57386a9434c23950fdb218604758a0c0293c2247da84/xtimeout-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "8b550085d48c0a1164be43e1e42ea76a", "sha256": "0cc2f4d7047f0bb85825011865377e992754bf236d2ecb3ac24f71b090b5c6a3" }, "downloads": -1, "filename": "xtimeout-0.1.2-cp36-cp36m-win32.whl", "has_sig": false, "md5_digest": "8b550085d48c0a1164be43e1e42ea76a", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 18896, "upload_time": "2018-04-22T17:32:22", "url": "https://files.pythonhosted.org/packages/1b/1d/244c465462e3424c596dc109ae558545da923a63edff27e33fac955d344b/xtimeout-0.1.2-cp36-cp36m-win32.whl" }, { "comment_text": "", "digests": { "md5": "c5d7abff55ec723b24e53169acbdc616", "sha256": "a0a34256d86506b782fef83e646094e907964701b08658b191d98561a998595e" }, "downloads": -1, "filename": "xtimeout-0.1.2.tar.gz", "has_sig": false, "md5_digest": "c5d7abff55ec723b24e53169acbdc616", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7231, "upload_time": "2018-04-22T17:32:23", "url": "https://files.pythonhosted.org/packages/30/92/b92c98a4ca75eecd757ac2c363963e8e368f08b9489aa45244a2574dc215/xtimeout-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "9ec29d7437859aa7a08d7bc7cfaf8243", "sha256": "43eb3b7ff4fb316e41309dd44e07b54834e9b0c846b67abcdd04598ff72c2faa" }, "downloads": -1, "filename": "xtimeout-0.1.3-cp36-cp36m-win32.whl", "has_sig": false, "md5_digest": "9ec29d7437859aa7a08d7bc7cfaf8243", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 323476, "upload_time": "2018-04-22T20:54:59", "url": "https://files.pythonhosted.org/packages/02/82/bd3a3cd28d6908c24e643f3c4ec3aa7d6b7bc046f5a6d7f15ac745fe241d/xtimeout-0.1.3-cp36-cp36m-win32.whl" }, { "comment_text": "", "digests": { "md5": "c68e6b03dd0f3fe352b5cf49e2719a6d", "sha256": "3e049f24b168cedffcf99f0212df2aee3a05481dc0b62b4bb338f92bb4f7d301" }, "downloads": -1, "filename": "xtimeout-0.1.3.tar.gz", "has_sig": false, "md5_digest": "c68e6b03dd0f3fe352b5cf49e2719a6d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7686, "upload_time": "2018-04-22T20:55:00", "url": "https://files.pythonhosted.org/packages/84/68/5a5bfb404ebbfb9b4a769756ccc93266174262a742db4663b70a71b7a941/xtimeout-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "b9400401a7dc877aff86b64d3583f7d2", "sha256": "70cc8a3c177735aecddbce74f45914262506fb7ba3f6bf4ecab88769316dcd40" }, "downloads": -1, "filename": "xtimeout-0.2.0-cp36-cp36m-win32.whl", "has_sig": false, "md5_digest": "b9400401a7dc877aff86b64d3583f7d2", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 322645, "upload_time": "2018-04-23T17:16:07", "url": "https://files.pythonhosted.org/packages/7e/ee/3aa1a1e271ecb67be671e93ec53607acb3ee3e33cf0681c7a19b70de9693/xtimeout-0.2.0-cp36-cp36m-win32.whl" }, { "comment_text": "", "digests": { "md5": "bf7d4645b4e794f5f38d912fcda8943a", "sha256": "12c17777b0d9d81549931d7a05e6336ab99ff6b6bc35be022a235be09727b6d5" }, "downloads": -1, "filename": "xtimeout-0.2.0.tar.gz", "has_sig": false, "md5_digest": "bf7d4645b4e794f5f38d912fcda8943a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8310, "upload_time": "2018-04-23T17:16:09", "url": "https://files.pythonhosted.org/packages/29/51/434d1defdc8369e2be34078e563dde8ace2f6dd1efb59611b3e7ed9df318/xtimeout-0.2.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "cf6fc2261b2a305ae063f8aca84c7c11", "sha256": "3abee3b9558d3afcfff841b136f41c826d5a4279ea6743b4d7bdb673e2221b18" }, "downloads": -1, "filename": "xtimeout-0.3.1.tar.gz", "has_sig": false, "md5_digest": "cf6fc2261b2a305ae063f8aca84c7c11", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8918, "upload_time": "2018-11-23T02:32:14", "url": "https://files.pythonhosted.org/packages/6f/07/64efe259993fb8250854c0d05e96b341a47e82df9df9cba9d2b2392077c4/xtimeout-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cf6fc2261b2a305ae063f8aca84c7c11", "sha256": "3abee3b9558d3afcfff841b136f41c826d5a4279ea6743b4d7bdb673e2221b18" }, "downloads": -1, "filename": "xtimeout-0.3.1.tar.gz", "has_sig": false, "md5_digest": "cf6fc2261b2a305ae063f8aca84c7c11", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8918, "upload_time": "2018-11-23T02:32:14", "url": "https://files.pythonhosted.org/packages/6f/07/64efe259993fb8250854c0d05e96b341a47e82df9df9cba9d2b2392077c4/xtimeout-0.3.1.tar.gz" } ] }