{ "info": { "author": "James Henstridge", "author_email": "james@jamesh.id.au", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)", "Operating System :: POSIX", "Programming Language :: Python :: 3" ], "description": "# GLib event loop integration for asyncio\n\nThis module provides a Python 3 [asyncio][1] event loop implementation\nthat makes use of the [GLib event loop][2]. This allows for mixing of\nasyncio and some GLib based code within the same thread.\n\nEnabling this event loop can be achieved with the following code:\n\n import asyncio\n import asyncio_glib\n asyncio.set_event_loop_policy(asyncio_glib.GLibEventLoopPolicy())\n\nAt this point, `asyncio.get_event_loop()` will return a `GLibEventLoop`.\n\n## Implementation strategy\n\nTo ease maintenance, I have tried to reuse as much of the standard\nlibrary asyncio code as possible. To this end, I created a GLib\nimplementation of the [`selectors.BaseSelector`][3] API. Combine this\nwith the existing `asyncio.SelectorEventLoop` class, and we have our\nevent loop implementation.\n\nTo test that the event loop is functional, I have reused parts of the\nstandard library test suite to run against the new selector and event\nloop.\n\nAt present the selector sublcasses the private\n`selectors._BaseSelectorImpl` class, which is a potential source of\nfuture compatibility problems. If that happens, taking a local copy\nof that code is an option.\n\n## Comparison with Gbulb\n\n[Gbulb][4] is another implementation of the asyncio event loop on top\nof GLib. The main differences are:\n\n * Gbulb dispatches asyncio callbacks directly from the GLib main\n loop. In contrast, asyncio-glib iterates the GLib main loop until\n an asyncio event is ready and then has asyncio event loop dispatch\n the event.\n\n * Gbulb has some Windows compatibility code, while asyncio-glib has\n had no testing on that platform.\n\n * asyncio-glib is an essentially unmodified `SelectorEventLoop`, so\n should automatically gain any features from new Python releases.\n\nThe asyncio-glib code base is also about one tenth of the size of Gbulb.\n\n[1]: https://docs.python.org/3/library/asyncio.html\n[2]: https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html\n[3]: https://docs.python.org/3/library/selectors.html\n[4]: https://github.com/nhoad/gbulb\n\n\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/jhenstridge/asyncio-glib", "keywords": "", "license": "LGPL-2.1+", "maintainer": "", "maintainer_email": "", "name": "asyncio-glib", "package_url": "https://pypi.org/project/asyncio-glib/", "platform": "", "project_url": "https://pypi.org/project/asyncio-glib/", "project_urls": { "Homepage": "https://github.com/jhenstridge/asyncio-glib" }, "release_url": "https://pypi.org/project/asyncio-glib/0.1/", "requires_dist": [ "PyGObject" ], "requires_python": "", "summary": "GLib event loop integration for asyncio", "version": "0.1" }, "last_serial": 5715485, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d40ab1dd931e554af06a032c3c6ef467", "sha256": "cae91a7b5f694927b04b452892c4ad2ec5296ab0d2462587a7d317bdf45ee9b7" }, "downloads": -1, "filename": "asyncio_glib-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d40ab1dd931e554af06a032c3c6ef467", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13880, "upload_time": "2019-08-22T14:13:35", "url": "https://files.pythonhosted.org/packages/90/ca/60ae11d48c276a5109953b056e78586aecfc7f1fa943ca5f934242bb649f/asyncio_glib-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "60153055e76ceaacdfbaeafb03d61dd9", "sha256": "fe3ceb2ba5f541330c07ca1bd7ae792468d625bad1acf5354a3a7a0b9fd87521" }, "downloads": -1, "filename": "asyncio-glib-0.1.tar.gz", "has_sig": false, "md5_digest": "60153055e76ceaacdfbaeafb03d61dd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13324, "upload_time": "2019-08-22T14:13:37", "url": "https://files.pythonhosted.org/packages/24/1c/83477e079cfcfb9cedbfbc905d72fee79604b35eec2a1b749eb9f0181733/asyncio-glib-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d40ab1dd931e554af06a032c3c6ef467", "sha256": "cae91a7b5f694927b04b452892c4ad2ec5296ab0d2462587a7d317bdf45ee9b7" }, "downloads": -1, "filename": "asyncio_glib-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d40ab1dd931e554af06a032c3c6ef467", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13880, "upload_time": "2019-08-22T14:13:35", "url": "https://files.pythonhosted.org/packages/90/ca/60ae11d48c276a5109953b056e78586aecfc7f1fa943ca5f934242bb649f/asyncio_glib-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "60153055e76ceaacdfbaeafb03d61dd9", "sha256": "fe3ceb2ba5f541330c07ca1bd7ae792468d625bad1acf5354a3a7a0b9fd87521" }, "downloads": -1, "filename": "asyncio-glib-0.1.tar.gz", "has_sig": false, "md5_digest": "60153055e76ceaacdfbaeafb03d61dd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13324, "upload_time": "2019-08-22T14:13:37", "url": "https://files.pythonhosted.org/packages/24/1c/83477e079cfcfb9cedbfbc905d72fee79604b35eec2a1b749eb9f0181733/asyncio-glib-0.1.tar.gz" } ] }