{"id":17276764,"url":"https://github.com/picosh/pubsub","last_synced_at":"2026-02-05T06:30:20.904Z","repository":{"id":255436809,"uuid":"849691787","full_name":"picosh/pubsub","owner":"picosh","description":"A generic pubsub implementation for Go","archived":false,"fork":false,"pushed_at":"2024-11-14T19:18:37.000Z","size":109,"stargazers_count":35,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T02:37:42.606Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pipe.pico.sh","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/picosh.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}},"created_at":"2024-08-30T04:14:32.000Z","updated_at":"2025-01-05T16:22:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"27845a58-f520-46bb-993c-a73008a79de2","html_url":"https://github.com/picosh/pubsub","commit_stats":null,"previous_names":["picosh/pubsub"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/picosh/pubsub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picosh%2Fpubsub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picosh%2Fpubsub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picosh%2Fpubsub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picosh%2Fpubsub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/picosh","download_url":"https://codeload.github.com/picosh/pubsub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picosh%2Fpubsub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29114910,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T05:31:32.482Z","status":"ssl_error","status_checked_at":"2026-02-05T05:31:29.075Z","response_time":65,"last_error":"SSL_read: 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":[],"created_at":"2024-10-15T09:01:04.459Z","updated_at":"2026-02-05T06:30:20.899Z","avatar_url":"https://github.com/picosh.png","language":"Go","readme":"# pubsub\n\n\u003e [!IMPORTANT]\\\n\u003e Code has moved to picosh/pico/pkg/pubsub\n\nA generic pubsub implementation for Go.\n\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\n\t\"github.com/picosh/pubsub\"\n)\n\nfunc main() {\n\tctx := context.TODO()\n\tlogger := slog.Default()\n\tbroker := pubsub.NewMulticast(logger)\n\n\tchann := []*pubsub.Channel{\n\t\tpubsub.NewChannel(\"my-topic\"),\n\t}\n\n\tgo func() {\n\t\twriter := bytes.NewBufferString(\"my data\")\n\t\t_ = broker.Pub(ctx, \"pubID\", writer, chann, false)\n\t}()\n\n\treader := bytes.NewBufferString(\"\")\n\t_ = broker.Sub(ctx, \"subID\", reader, chann, false)\n\n\t// result\n\tfmt.Println(\"data from pub:\", reader)\n}\n```\n\n## pubsub over ssh\n\nThe simplest pubsub system for everyday automation needs.\n\nUsing `wish` we can integrate our pubsub system into an SSH app.\n\n[![asciicast](https://asciinema.org/a/674287.svg)](https://asciinema.org/a/674287)\n\n```bash\n# term 1\nmkdir ./ssh_data\ncat ~/.ssh/id_ed25519 ./ssh_data/authorized_keys\ngo run ./cmd/example\n\n# term 2\nssh -p 2222 localhost sub xyz\n\n# term 3\necho \"hello world\" | ssh -p 2222 localhost pub xyz\n```\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicosh%2Fpubsub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpicosh%2Fpubsub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicosh%2Fpubsub/lists"}