{ "info": { "author": "Ian Bicking", "author_email": "ianb@colorstudy.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Internet :: WWW/HTTP :: WSGI", "Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware" ], "description": "Wait For It\n===========\n\nStatus And License\n------------------\n\n*Wait For It* is distributed under an `MIT-style license\n`_. It is by Ian\nBicking. Questions can go to the `Paste mailing list\n`_; bugs can be reported in the\n`Paste Bug Tracker `_.\n\nWhat It Does\n------------\n\nWait For It gives users a timely response even when the underlying\nWSGI application isn't very timely. Wait For It does this by\nlaunching an extra thread for each incoming request. If the wrapped\napplication responds in a timely manner (before ``time_limit``) the\nresponse is simply passed on.\n\nIf the response doesn't come back before the time limit, the user is\ngiven a response page that asks them to wait. The response page\ncontains Javascript that will re-check the status of the page, and\nwhen the page is ready it will reload the page.\n\nApplications can provide feedback to users by looking for\n``environ['waitforit.progress']`` and putting information in there.\nIn particular ``\"message\"`` contains an HTML message for the user\n(e.g., if you want to show what step the long-running application is\nworking on). ``\"percent\"`` is used for a progress bar; it should be a\nnumber from 0 to 100. The value in ``progress`` is sent via JSON, so\nyou should use only strings (preferably unicode), integers, floats,\ndictionaries (with string keys) and lists.\n\nUsing It\n--------\n\nWrap you application like this::\n\n from waitforit import WaitForIt\n \n fast_app = WaitForIt(slow_app, time_limit=5, poll_time=10)\n\nThen if ``slow_app`` takes longer than 5 seconds, a transition page is\nshown. The transition page checks to see if the response is done\nevery 10 seconds. (The default values for both parameters is 10\nseconds.)\n\nIn your application you can do::\n\n def slow_app(environ, start_response):\n progress = environ.get('waitforit.progress', {})\n for i in range(100):\n progress['message'] = 'I have completed %s out of 100 tasks' % i\n progress['percent'] = i\n ... handle response ...\n\nAlso if some requests should be handled synchronously (even if they\nmay be slow) you can indicate that with::\n\n def slow_app(environ, start_response):\n progress = environ.get('waitforit.progress', {})\n if you_should_really_wait_for_this_to_return(environ):\n progress['synchronous'] = True\n ...\n\nThat is, setting ``environ['waitforit.progress']['synchronous'] =\nTrue``, if done in a timely way, will keep WaitForIt from intercepting\nthe request.\n\nDownload & Installation\n-----------------------\n\nYou can install with ``easy_install WaitForIt``. You can also install\nthe most recent code from trunk with ``easy_install WaitForIt==dev``.\nYou can see the most recent code in `the svn repository\n`_,\nor check it out like::\n\n svn co http://svn.pythonpaste.org/Paste/WaitForIt/trunk WaitForIt\n\nExample\n-------\n\nTo see a simple example, see `waitforit.testapp\n`_. You can run it like ``python\nwaitforit/testapp.py`` (or if you are using Python 2.5, ``python -m\nwaitforit.testapp``).", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pythonpaste.org/waitforit/", "keywords": "wsgi threads paste", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "WaitForIt", "package_url": "https://pypi.org/project/WaitForIt/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/WaitForIt/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pythonpaste.org/waitforit/" }, "release_url": "https://pypi.org/project/WaitForIt/0.2/", "requires_dist": null, "requires_python": null, "summary": "Provide an intermediate response when a WSGI application slow to respond", "version": "0.2" }, "last_serial": 27306, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "0630d6aac87dfd482ed22e116f49bc1e", "sha256": "208b2e8e4d3410721a7023a966ccfaa3c3cdd0b67870f21adae7a35ff7124872" }, "downloads": -1, "filename": "WaitForIt-0.1-py2.4.egg", "has_sig": false, "md5_digest": "0630d6aac87dfd482ed22e116f49bc1e", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 12708, "upload_time": "2007-05-26T18:48:38", "url": "https://files.pythonhosted.org/packages/26/7b/e8cca4e8e1136c742d630b2b52a5ebcf257982da1d12fa79cd7a1926d6b0/WaitForIt-0.1-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "e3f88fed01b55e524c0d341ea6104b79", "sha256": "9e86fc9f977d06f639324434552dbd233b5b4e20c434540c476c098614296b35" }, "downloads": -1, "filename": "WaitForIt-0.1.tar.gz", "has_sig": false, "md5_digest": "e3f88fed01b55e524c0d341ea6104b79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7275, "upload_time": "2007-05-26T18:48:37", "url": "https://files.pythonhosted.org/packages/30/6d/9a712f7df51dbf912d4191cf3aeb93e7068286d4532c251fb30813aee468/WaitForIt-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "03199a022fa6701036a1c00dd3e7ff3d", "sha256": "ff9235d51370f1e1e79039dc472c80deca674f1a13654d4615fe9a11a4cde91c" }, "downloads": -1, "filename": "WaitForIt-0.2-py2.4.egg", "has_sig": false, "md5_digest": "03199a022fa6701036a1c00dd3e7ff3d", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 13199, "upload_time": "2007-05-28T18:46:58", "url": "https://files.pythonhosted.org/packages/f0/24/0f4720908b702947c569c481652e9e6cb153049bd49f07b72cb17ad8f6a9/WaitForIt-0.2-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "0b55a05078dce9ebceeebadbaf473952", "sha256": "feeba8eae923a18e36546f240476efc0362033cc59b6d41f133d928370d75251" }, "downloads": -1, "filename": "WaitForIt-0.2.tar.gz", "has_sig": false, "md5_digest": "0b55a05078dce9ebceeebadbaf473952", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7928, "upload_time": "2007-05-28T18:46:57", "url": "https://files.pythonhosted.org/packages/d5/91/2770b9d84919b2588e19e280834b03843458c62dae0fbf39de8cdc27d47d/WaitForIt-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "03199a022fa6701036a1c00dd3e7ff3d", "sha256": "ff9235d51370f1e1e79039dc472c80deca674f1a13654d4615fe9a11a4cde91c" }, "downloads": -1, "filename": "WaitForIt-0.2-py2.4.egg", "has_sig": false, "md5_digest": "03199a022fa6701036a1c00dd3e7ff3d", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 13199, "upload_time": "2007-05-28T18:46:58", "url": "https://files.pythonhosted.org/packages/f0/24/0f4720908b702947c569c481652e9e6cb153049bd49f07b72cb17ad8f6a9/WaitForIt-0.2-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "0b55a05078dce9ebceeebadbaf473952", "sha256": "feeba8eae923a18e36546f240476efc0362033cc59b6d41f133d928370d75251" }, "downloads": -1, "filename": "WaitForIt-0.2.tar.gz", "has_sig": false, "md5_digest": "0b55a05078dce9ebceeebadbaf473952", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7928, "upload_time": "2007-05-28T18:46:57", "url": "https://files.pythonhosted.org/packages/d5/91/2770b9d84919b2588e19e280834b03843458c62dae0fbf39de8cdc27d47d/WaitForIt-0.2.tar.gz" } ] }