{ "info": { "author": "David Wolever", "author_email": "david@wolever.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "gevent-helpers\n==============\n\n``gevent-helpers`` contains a collection of utilities which are helpful while\ndeveloping with ``gevent``.\n\nCompatible with ``gevent==1.0rc3``.\n\nfork()\n------\nA workaround for `gevent issue 154`__, until that issue is fixed.\n\n__ http://code.google.com/p/gevent/issues/detail?id=154\n\nBlockingDetector(timeout=1, raise_exc=AlarmInterrupt, aggressive=True)\n----------------------------------------------------------------------\n\nUse operating system signals to detect blocking threads.\n\n``timeout=1`` is the number of seconds to wait before considering the\nthread blocked (note: if ``signal.setitimer`` or the ``itimer`` package is\navailable, this can be a real number; otherwise it will be rounded up to\nthe nearest integer).\n\n``raise_exc=AlarmInterrupt`` controls which exception will be raised\nin the blocking thread. If ``raise_exc`` is False-ish, no exception will be\nraised (a ``log.warning`` message, including stack trace, will always be\nissued). **NOTE**: the default value, ``AlarmInterrupt``, is a subclass of\n``BaseException``, so it *will not* be caught by ``except Exception:`` (it\nwill be caught by ``dirt.runloop``). For example::\n\n # Don't raise an exception, only log a warning message and stack trace:\n BlockingDetector(raise_exc=False)\n\n # Raise ``MyException()`` and lot a warning message:\n BlockingDetector(raise_exc=MyException())\n\n # Raise ``MyException(\"blocking detected after timeout=...\")`` and log\n # a warning message:\n BlockingDetector(raise_exc=MyException)\n\n``aggressive=True`` determines whether the blocking detector will reset\nas soon as it is triggered, or whether it will wait until the blocking\nthread yields before it resets. For example, if ``aggressive=True``,\n``raise_exc=False``, and ``timeout=1``, a log message will be written for\nevery second that a thread blocks. However, if ``aggressive=False``, only\none log message will be written until the blocking thread yields, at which\npoint the alarm will be reset.\n\nNote: ``BlockingDetector`` overwrites the ``signal.SIGALRM`` handler and\ndoes not attempt to save the previous value.\n\nFor example::\n\n >>> def spinblock():\n ... while True:\n ... pass\n >>> gevent.spawn(BlockingDetector())\n >>> gevent.sleep()\n >>> spinblock()\n Traceback (most recent call last):\n File \"\", line 1, in \n File \"\", line 3, in spinblock\n File \".../dirt/misc/gevent_.py\", line 167, in alarm_handler\n raise exc\n gevent_helpers.AlarmInterrupt: blocking detected after timeout=1", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/wolever/gevent-helpers", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "gevent-helpers", "package_url": "https://pypi.org/project/gevent-helpers/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/gevent-helpers/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/wolever/gevent-helpers" }, "release_url": "https://pypi.org/project/gevent-helpers/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "UNKNOWN", "version": "0.1.1" }, "last_serial": 896248, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "93291d7f5f585970e015d9989c385e2d", "sha256": "4870b19928b51b39952b40e6c696f7f97a45ee150edf407501958479b584de5b" }, "downloads": -1, "filename": "gevent-helpers-0.1.1.tar.gz", "has_sig": false, "md5_digest": "93291d7f5f585970e015d9989c385e2d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3666, "upload_time": "2013-10-16T22:50:26", "url": "https://files.pythonhosted.org/packages/3f/ef/aa2ffbd3dc58d88a2a7df24b62c9162d06650c3ca63365865345a3df2b2f/gevent-helpers-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "93291d7f5f585970e015d9989c385e2d", "sha256": "4870b19928b51b39952b40e6c696f7f97a45ee150edf407501958479b584de5b" }, "downloads": -1, "filename": "gevent-helpers-0.1.1.tar.gz", "has_sig": false, "md5_digest": "93291d7f5f585970e015d9989c385e2d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3666, "upload_time": "2013-10-16T22:50:26", "url": "https://files.pythonhosted.org/packages/3f/ef/aa2ffbd3dc58d88a2a7df24b62c9162d06650c3ca63365865345a3df2b2f/gevent-helpers-0.1.1.tar.gz" } ] }