{"id":34216709,"url":"https://github.com/aruuunn/pubsub","last_synced_at":"2026-03-10T23:02:13.585Z","repository":{"id":57617123,"uuid":"385277251","full_name":"aruuunn/pubsub","owner":"aruuunn","description":"A small package which implements publisher - subscriber pattern in pure Golang.","archived":false,"fork":false,"pushed_at":"2021-07-13T12:14:15.000Z","size":19,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-14T17:48:54.086Z","etag":null,"topics":["golang","publish-subscribe","pubsub"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/arunmurugan78/pubsub","language":"Go","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/aruuunn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-12T14:32:42.000Z","updated_at":"2023-03-07T09:39:10.000Z","dependencies_parsed_at":"2022-08-29T04:30:59.770Z","dependency_job_id":null,"html_url":"https://github.com/aruuunn/pubsub","commit_stats":null,"previous_names":["aruuunn/pubsub","arunmurugan78/pubsub"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aruuunn/pubsub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aruuunn%2Fpubsub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aruuunn%2Fpubsub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aruuunn%2Fpubsub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aruuunn%2Fpubsub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aruuunn","download_url":"https://codeload.github.com/aruuunn/pubsub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aruuunn%2Fpubsub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30360533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"ssl_error","status_checked_at":"2026-03-10T21:40:59.357Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["golang","publish-subscribe","pubsub"],"created_at":"2025-12-15T22:13:44.253Z","updated_at":"2026-03-10T23:02:13.580Z","avatar_url":"https://github.com/aruuunn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 PubSub\n\n\n[![GoDoc](https://godoc.org/github.com/kkdai/maglev?status.svg)](https://godoc.org/github.com/arunmurugan78/pubsub) \n[![Go](https://github.com/ArunMurugan78/pubsub/actions/workflows/go.yml/badge.svg)](https://github.com/ArunMurugan78/pubsub/actions/workflows/go.yml)\n\nA small package which implements publisher - subscriber pattern in pure Golang.\n\n## Installation \n\n```bash\ngo get github.com/arunmurugan78/pubsub\n```\n\n## Quick start\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/arunmurugan78/pubsub\"\n\t\"sync\"\n)\n\nfunc main() {\n\tvar wg sync.WaitGroup\n\tctx := context.Background()\n\n\t//Create a new PubSub instance\n\tpbsb := pubsub.New(ctx)\n\n\tchannelNames := []string{\"channelOne\", \"channelTwo\"}\n\n\t//Subscribe to required \"channels\"\n\tsub := pbsb.NewSubscription(channelNames)\n\tdefer sub.UnSubscribe()\n\n\t//Will get the published data through this go channel\n\tchannel := sub.Channel()\n\n\twg.Add(1)\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tselect {\n\t\tcase message := \u003c-channel:\n\t\t\t// Received Data will be of type pubsub.Message\n\t\t\tfmt.Println(\"Received \", message.Value, \" from \", message.ChannelName)\n\t\t\t//Output \"Received  100  from  channelTwo\"\n\t\tcase \u003c-ctx.Done():\n\t\t\treturn\n\t\t}\n\t}()\n\n\t//Publish data to the specified channels\n\t//Here we are publishing value 100 to channelTwo\n\tpbsb.Publish([]string{\"channelTwo\"}, 100)\n\twg.Wait()\n}\n\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faruuunn%2Fpubsub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faruuunn%2Fpubsub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faruuunn%2Fpubsub/lists"}