{ "info": { "author": "Andrea Corbellini", "author_email": "corbellini.andrea@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "iowait -- Platform-independent module for I/O completion events\n===============================================================\n\nDifferent operating systems provide different ways to wait for I/O completion\nevents: there's ``select()``, ``poll()``, ``epoll()`` and ``kqueue()``. For\ncross-platform applications it can be a pain to support all this system\nfunctions, especially because each one provides a different interface.\n\nIOWait solves this problem by providing a unified interface and using always\nthe best and faster function available in the platform. Its only limitation is\nthat, on Windows, it only works for sockets.\n\nThis library is compatible both with Python 2 and 3.\n\n\nExample\n-------\n\nHere is an usage example. First, we need to create a pair of sockets:\n\n >>> import socket\n >>> a, b = socket.socketpair()\n\nThen we create a ``IOWait`` object. This object is essentially a wrapper around\na system function (such as ``select()`` or ``poll()``), but exposes always the\nsame methods and behaves always the same.\n\n >>> from iowait import IOWait\n >>> waitobj = IOWait()\n\nNow we can watch the first socket for read events in this way:\n\n >>> waitobj.watch(a, read=True)\n\nWe send some data over the other socket:\n\n >>> b.sendall('this is a test')\n\nCalling ``wait()`` on the ``IOWait`` object will tell us that the socket a is\nready to be read:\n\n >>> events = waitobj.wait()\n >>> events #doctest:+ELLIPSIS\n [IOEvent(fileobj=, read=True, write=False)]\n\nThe return value of ``wait()`` is a list of three-tuples in the format:\n``(file, read, write)``, where ``file`` is a file-like object, ``read`` and\n``write`` tell respectively whether the file is ready to be read or written.\n\nOnce all the data has been read, the next call to ``wait()`` will block\nforever, unless a timeout is specified. The timeout can be zero:\n\n >>> a.recv(14)\n 'this is a test'\n >>> waitobj.wait(0)\n []\n\n\nDocumentation\n-------------\n\nThe documentation is stored in the module's doc string. To read it, use the\nPython interactive interpreter:\n\n >>> import iowait\n >>> help(iowait) #doctest:+SKIP", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://launchpad.net/python-iowait", "keywords": null, "license": "GNU LGPL v3", "maintainer": null, "maintainer_email": null, "name": "iowait", "package_url": "https://pypi.org/project/iowait/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/iowait/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://launchpad.net/python-iowait" }, "release_url": "https://pypi.org/project/iowait/0.2/", "requires_dist": null, "requires_python": null, "summary": "Platform-independent module for I/O completion events", "version": "0.2" }, "last_serial": 860061, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "f928f3c54cfa2c054e889abe936cd775", "sha256": "3955f72a78184ae8791bef75b9a38dcf8592da7cb6499b0b3d3712ef50c1fefe" }, "downloads": -1, "filename": "iowait-0.1.tar.gz", "has_sig": true, "md5_digest": "f928f3c54cfa2c054e889abe936cd775", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19978, "upload_time": "2011-03-04T15:00:21", "url": "https://files.pythonhosted.org/packages/2e/42/a79b7fd643bdc191f31bf87e87a0b8e37689a5c4a73ab3de4e5804661097/iowait-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "f49ca7766fe4a67e03a731e575614f87", "sha256": "ab1bc2eb84c22ccf61f17a0024f9fb6df781b39f1852764a66a7769d5adfb299" }, "downloads": -1, "filename": "iowait-0.2.tar.gz", "has_sig": false, "md5_digest": "f49ca7766fe4a67e03a731e575614f87", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22339, "upload_time": "2013-09-08T14:22:16", "url": "https://files.pythonhosted.org/packages/65/30/e953673fe9619938e9c74408401cf865f37716da89f61f6e5d9328c0f71e/iowait-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f49ca7766fe4a67e03a731e575614f87", "sha256": "ab1bc2eb84c22ccf61f17a0024f9fb6df781b39f1852764a66a7769d5adfb299" }, "downloads": -1, "filename": "iowait-0.2.tar.gz", "has_sig": false, "md5_digest": "f49ca7766fe4a67e03a731e575614f87", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22339, "upload_time": "2013-09-08T14:22:16", "url": "https://files.pythonhosted.org/packages/65/30/e953673fe9619938e9c74408401cf865f37716da89f61f6e5d9328c0f71e/iowait-0.2.tar.gz" } ] }