{"id":37083597,"url":"https://github.com/bright2227/uringloop","last_synced_at":"2026-01-14T10:12:04.687Z","repository":{"id":288776892,"uuid":"961288979","full_name":"bright2227/uringloop","owner":"bright2227","description":"A Python implementation of a liburing-based proactor event loop for asyncio.","archived":false,"fork":false,"pushed_at":"2025-05-03T08:45:40.000Z","size":55,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-23T14:40:33.604Z","etag":null,"topics":["asyncio","liburing","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bright2227.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-06T07:24:58.000Z","updated_at":"2025-09-01T08:57:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"b4f204ac-efd1-4178-bd7d-d7cb13e5a2d5","html_url":"https://github.com/bright2227/uringloop","commit_stats":null,"previous_names":["bright2227/uringloop"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bright2227/uringloop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bright2227%2Furingloop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bright2227%2Furingloop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bright2227%2Furingloop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bright2227%2Furingloop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bright2227","download_url":"https://codeload.github.com/bright2227/uringloop/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bright2227%2Furingloop/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28416674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asyncio","liburing","python","python3"],"created_at":"2026-01-14T10:12:03.938Z","updated_at":"2026-01-14T10:12:04.680Z","avatar_url":"https://github.com/bright2227.png","language":"Python","readme":"# uringloop\n\nA Python implementation of a liburing-based proactor event loop for asyncio, designed to follow Python standard library conventions. The implementation is written primarily in pure Python, using CFFI only for wrapping the liburing interface.\n\n- Implements a Proactor pattern similar to Windows' IOCP ([reference implementation](https://github.com/python/cpython/blob/d16f455cd8cabbc1e7bd2369cdb8718c30ab8957/Lib/asyncio/windows_events.py#L417))\n- Follows Python's standard asyncio implementation patterns\n\n\u003e ⚠️ Note: This is currently experimental and not yet stable\n\n## Goals\n\n- Provide a primarily Python (with CFFI, maybe C extention in future) implementation of a liburing-based event loop\n- Maintain full compatibility with standard asyncio APIs\n- Follow Python standard library implementation patterns\n\n## Requirements\n\n- Linux 5.19+ kernel\n\n- Python 3.12+\n\n- liburing development libraries\n\n  ```bash\n  sudo apt install liburing-dev\n  ```\n\n## Installation\n\n- Using uv:\n\n```bash\nuv add uringloop\n```\n\n- Using pip:\n\n```bash\npip install uringloop\n```\n\n## Quick Start\n\nSet the event loop policy with asyncio.set_event_loop_policy(IouringProactorEventLoopPolicy()) to use the io_uring-based event loop.\n\n```python\nimport asyncio\n\nfrom uringloop import IouringProactorEventLoopPolicy\n\n\nasyncio.set_event_loop_policy(IouringProactorEventLoopPolicy())\n\n\nasync def handle_client(reader: asyncio.StreamReader, writer: asyncio.StreamWriter):\n    addr = writer.get_extra_info('peername')\n    print(f\"Connection from {addr}\")\n\n    while True:\n        data = await reader.read(1024)\n        if not data:\n            break\n        print(f\"Received: {data.decode()}\")\n        writer.write(data)\n        await writer.drain()\n\n    print(f\"Connection with {addr} closed\")\n    writer.close()\n\n\nasync def start_server():\n    server = await asyncio.start_server(\n        handle_client, '127.0.0.1', 8888)\n    addr = server.sockets[0].getsockname()\n    print(f'Serving on {addr}')\n\n    async with server:\n        await server.serve_forever()\n\n\nasync def tcp_client(message: str):\n    reader, writer = await asyncio.open_connection(\n        '127.0.0.1', 8888)\n\n    print(f'Send: {message!r}')\n    writer.write(message.encode())\n    await writer.drain()\n\n    data = await reader.read(100)\n    print(f'Received: {data.decode()!r}')\n\n    print('Closing connection')\n    writer.close()\n    await writer.wait_closed()\n\n\nasync def main():\n    # Start the server in the background\n    server_task = asyncio.create_task(start_server())\n\n    # Give the server a moment to start\n    await asyncio.sleep(1)\n\n    # Run the client\n    await tcp_client('Hello, World!')\n\n    # Cancel the server task (otherwise it runs forever)\n    server_task.cancel()\n    try:\n        await server_task\n    except asyncio.CancelledError:\n        pass\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n\n```\n\nthe result would looks like\n\n```console\nServing on ('127.0.0.1', 8888)\nSend: 'Hello, World!'\nConnection from ('0.0.0.0', 0)\nReceived: Hello, World!\nReceived: 'Hello, World!'\nClosing connection\nConnection with ('0.0.0.0', 0) closed\n```\n\n## Contributing\n\nContributions are welcome! Please open issues or pull requests for any bugs or feature requests.\n\n## License\n\nThis project is licensed under the terms of the MIT license.\n\n## TODO\n\n- use registered fd and buffer\n- add signal handling\n- refactor e2e test\n- benchmark\n- figure out a way to do unit/integration test\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbright2227%2Furingloop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbright2227%2Furingloop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbright2227%2Furingloop/lists"}