{"id":20877216,"url":"https://github.com/badu/fanout","last_synced_at":"2026-03-12T14:16:14.945Z","repository":{"id":219858643,"uuid":"617837634","full_name":"badu/fanout","owner":"badu","description":"Fan Out design pattern (aka broadcasting channel using generics)","archived":false,"fork":false,"pushed_at":"2023-03-24T12:03:57.000Z","size":4,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-29T12:39:11.423Z","etag":null,"topics":["fanout","go","golang","pubsub"],"latest_commit_sha":null,"homepage":"","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/badu.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":"2023-03-23T08:06:26.000Z","updated_at":"2025-02-18T09:17:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"605e51b1-d6f0-4db7-b73f-eec6c32d67a8","html_url":"https://github.com/badu/fanout","commit_stats":null,"previous_names":["badu/fanout"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/badu/fanout","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badu%2Ffanout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badu%2Ffanout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badu%2Ffanout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badu%2Ffanout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/badu","download_url":"https://codeload.github.com/badu/fanout/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badu%2Ffanout/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30428005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:00:25.264Z","status":"ssl_error","status_checked_at":"2026-03-12T13:59:52.690Z","response_time":114,"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":["fanout","go","golang","pubsub"],"created_at":"2024-11-18T06:56:20.595Z","updated_at":"2026-03-12T14:16:14.906Z","avatar_url":"https://github.com/badu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fan Out\n\nFan Out design pattern, using channels with generics.\n\n## What problem does it solve?\n\nFan Out pattern is a software architecture pattern that involves distributing data (messages / payloads) from a single\nsender (publisher) to multiple receivers (listeners).\n\nEach recipient receives a copy of the message - if your `payload` is a pointer, that would violate the pattern. \n\nThe Fan Out pattern is useful in situations where multiple components of a system need to `react` to the same `event` or\nreceive the same `data`.\n\nThis is a naive implementation of the Fan Out pattern, using channels and generics. \n\nIn its shortest form, it looks like this:\n\n```go\npackage mypack\n\nfunc FanOut[T any](from \u003c-chan T, to ...chan\u003c- T) {\n\tfor v := range from {\n\t\tfor _, ch := range to {\n\t\t\tch \u003c- v\n\t\t}\n\t}\n}\n\n```\n\n## Usage\n\n`go get github.com/badu/fanout`\n\nT. B. D.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadu%2Ffanout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbadu%2Ffanout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadu%2Ffanout/lists"}