{"id":26471125,"url":"https://github.com/mandrewcito/event_channel","last_synced_at":"2025-07-03T08:33:10.465Z","repository":{"id":34901873,"uuid":"188356187","full_name":"mandrewcito/event_channel","owner":"mandrewcito","description":"Tiny pub sub implentation","archived":false,"fork":false,"pushed_at":"2023-01-15T21:16:34.000Z","size":45,"stargazers_count":10,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T19:17:53.519Z","etag":null,"topics":["pubsub","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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mandrewcito.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}},"created_at":"2019-05-24T05:12:12.000Z","updated_at":"2023-10-16T15:44:30.000Z","dependencies_parsed_at":"2023-01-16T23:00:56.330Z","dependency_job_id":null,"html_url":"https://github.com/mandrewcito/event_channel","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandrewcito%2Fevent_channel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandrewcito%2Fevent_channel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandrewcito%2Fevent_channel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandrewcito%2Fevent_channel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mandrewcito","download_url":"https://codeload.github.com/mandrewcito/event_channel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244506034,"owners_count":20463464,"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":["pubsub","python","python3"],"created_at":"2025-03-19T20:53:23.557Z","updated_at":"2025-03-19T20:53:24.126Z","avatar_url":"https://github.com/mandrewcito.png","language":"Python","funding_links":["https://www.paypal.me/mandrewcito/1)"],"categories":[],"sub_categories":[],"readme":"# Event Channel\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg?logo=paypal\u0026style=flat-square)](https://www.paypal.me/mandrewcito/1)\u0026nbsp;\n![Pypi](https://img.shields.io/pypi/v/event_channel.svg)\n[![Downloads](https://pepy.tech/badge/event-channel)](https://pepy.tech/project/event-channel)\n[![Downloads](https://pepy.tech/badge/event-channel/month)](https://pepy.tech/project/event-channel/month)\n![Travis ci](https://img.shields.io/travis/mandrewcito/event_channel.svg)\n![Issues](https://img.shields.io/github/issues/mandrewcito/event_channel.svg)\n![Open issues](https://img.shields.io/github/issues-raw/mandrewcito/event_channel.svg)\n![codecov.io](https://codecov.io/github/mandrewcito/event_channel/coverage.svg?branch=master)\n\nAnother library with a pub/sub implementation. You can subscribe functions to a certain topic (aka event). When a message is sent through this event callback functions subscribed will be executed.\n\n```python\nfrom event_channel import EventChannel\n\nmychannel = EventChannel() # You can also import channel, is an instance already created\n\ndef callback(x):\n    x = x + 1\n    print(x)\n\nmychannel.subscribe(\"myevent\", callback)\n\nmychannel.publish(\"myevent\", 345)\n\nchannel.unsubscribe(\"myevent\", callback)\n```\n\n\n```python\n\nfrom event_channel.threaded_event_channel import ThreadedEventChannel\n\nmychannel =  ThreadedEventChannel(blocking=False) # You can also import non_blocking_channel, is an instance already created\n\ndef callback(x):\n    x = x + 1\n    print(x)\n\nmychannel.subscribe(\"myevent\", callback)\nmychannel.subscribe(\"myevent\", callback2)\n\nthreads = mychannel.publish(\"myevent\", 345)\n\n# Wait thread finish\nfor thread in threads:\n    thread.join()\n```\n\n```python\n\nfrom event_channel.threaded_event_channel import ThreadedEventChannel\n\nmy_blocking_channel = ThreadedEventChannel() # You can also import channel, is an instance already created\n\ndef callback(x):\n    x = x + 1\n    print(x)\n\nmychannel.subscribe(\"myevent\", callback)\nmychannel.subscribe(\"myevent\", callback2)\n\nthreads = mychannel.publish(\"myevent\", 345)\n#at this point all threads are finished\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmandrewcito%2Fevent_channel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmandrewcito%2Fevent_channel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmandrewcito%2Fevent_channel/lists"}