{"id":20291058,"url":"https://github.com/theruziev/aio_pubsub","last_synced_at":"2025-06-11T07:37:25.674Z","repository":{"id":33782183,"uuid":"155669940","full_name":"theruziev/aio_pubsub","owner":"theruziev","description":"A generic interface wrapping multiple backends to provide a consistent pubsub API.","archived":false,"fork":false,"pushed_at":"2023-04-18T18:04:41.000Z","size":359,"stargazers_count":11,"open_issues_count":2,"forks_count":5,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-02T07:15:24.370Z","etag":null,"topics":["asyncio","pubsub","python36"],"latest_commit_sha":null,"homepage":"http://aiopubsub.rtfd.io","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/theruziev.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2018-11-01T06:13:14.000Z","updated_at":"2025-03-03T00:57:16.000Z","dependencies_parsed_at":"2023-01-15T02:29:12.670Z","dependency_job_id":null,"html_url":"https://github.com/theruziev/aio_pubsub","commit_stats":null,"previous_names":["bruziev/async_pubsub"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theruziev%2Faio_pubsub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theruziev%2Faio_pubsub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theruziev%2Faio_pubsub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theruziev%2Faio_pubsub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theruziev","download_url":"https://codeload.github.com/theruziev/aio_pubsub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248381761,"owners_count":21094525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","pubsub","python36"],"created_at":"2024-11-14T15:10:16.200Z","updated_at":"2025-04-11T11:08:37.842Z","avatar_url":"https://github.com/theruziev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"AioPubSub\n=========\n\n.. image:: https://travis-ci.com/theruziev/aio_pubsub.svg?branch=master\n   :target: https://travis-ci.com/theruziev/aio_pubsub\n\n.. image:: https://codecov.io/gh/theruziev/aio_pubsub/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/theruziev/aio_pubsub/branch/master\n\n\nA generic interface wrapping multiple backends to provide a consistent pubsub API.\n\nInstallation\n------------\n\n.. code-block:: bash\n\n    pip install aio-pubsub\n    # for redis backend\n    pip install aio-pubsub[aioredis]\n    # for postgresql backend\n    pip install aio-pubsub[aiopg]\n\nUsage\n------\nTo use it, you need to implement your pubsub implementation from interfaces or use backends\nfrom ``aio_pubsub.backends`` package\n\n.. code-block:: python\n\n    import asyncio\n\n    from aio_pubsub.backends.memory import MemoryPubSub\n\n    pubsub = MemoryPubSub()\n\n\n    async def sender():\n        \"\"\"Publish a new message each second\"\"\"\n        counter = 0\n        while True:\n            await pubsub.publish(\"a_chan\", \"hello world %s !\" % counter)\n\n            await asyncio.sleep(1)\n            counter += 1\n\n\n    async def receiver():\n        \"\"\"Print all message received from channel\"\"\"\n\n        subscriber = await pubsub.subscribe(\"a_chan\")\n\n        async for message in subscriber:\n            print(\"Received message: '%s'\" % message)\n\n\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(\n        asyncio.gather(sender(), receiver())\n    )\n    loop.close()\n\n\nSupported backends\n---------------------\n\n``Disclaimer``: I would not advise you to use this backend, because it is shown only for testing purposes.\nBetter develop your own implementation.\n\n* memory\n* redis\n* postgresql\n* mongodb","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheruziev%2Faio_pubsub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheruziev%2Faio_pubsub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheruziev%2Faio_pubsub/lists"}