{"id":36871668,"url":"https://github.com/atedja/go-eventcast","last_synced_at":"2026-01-12T15:02:03.442Z","repository":{"id":57567766,"uuid":"46779704","full_name":"atedja/go-eventcast","owner":"atedja","description":"Simple event broadcasting","archived":false,"fork":false,"pushed_at":"2017-03-12T01:09:00.000Z","size":7,"stargazers_count":22,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T07:55:40.224Z","etag":null,"topics":["channels","event-broadcasting","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atedja.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":"2015-11-24T09:06:08.000Z","updated_at":"2021-08-05T09:14:37.000Z","dependencies_parsed_at":"2022-08-28T10:00:49.234Z","dependency_job_id":null,"html_url":"https://github.com/atedja/go-eventcast","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/atedja/go-eventcast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atedja%2Fgo-eventcast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atedja%2Fgo-eventcast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atedja%2Fgo-eventcast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atedja%2Fgo-eventcast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atedja","download_url":"https://codeload.github.com/atedja/go-eventcast/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atedja%2Fgo-eventcast/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28340415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["channels","event-broadcasting","go","golang"],"created_at":"2026-01-12T15:02:03.359Z","updated_at":"2026-01-12T15:02:03.424Z","avatar_url":"https://github.com/atedja.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eventcast\n\n[![Build Status](https://travis-ci.org/atedja/go-eventcast.svg?branch=master)](https://travis-ci.org/atedja/go-eventcast)\n\nSimple event broadcasting.\n\n### Examples\n\n#### Signaling arbitrary number of workers\n\n```go\n  // spawn workers\n  for i := 0; i \u003c 100; i++ {\n    go func() {\n      closed := eventcast.Listen(\"we are closed\")\n      for {\n        select {\n        case \u003c-closed:\n          return\n        default:\n          // do other things\n        }\n      }\n    }()\n  }\n\n  // somewhere, sometime later..\n  eventcast.Broadcast(\"we are closed\")\n```\n\n#### Broadcasting a value to multiple listeners\n\n```go\n  // goroutines waiting for some result or timeout.\n  for i := 0; i \u003c 10; i++ {\n    go func() {\n      select {\n      case value := \u003c-eventcast.Listen(\"result\"):\n        // do something with value\n      case \u003c-time.After(1 * time.Second):\n        // timeout!\n        break\n      }\n    }()\n  }\n\n  // some worker\n  go func() {\n    // doing something...\n\n    value := \"result of processing some data\"\n    eventcast.BroadcastWithValue(\"result\", value)\n\n    // continue doing more\n  }()\n```\n\n#### Racing Your Pigs\n\n```go\n  // go pig!\n  finished := eventcast.Listen(\"finished\")\n  for i := 0; i \u003c 10; i++ {\n    go func(i int) {\n      \u003c-eventcast.Listen(\"ready\")\n      \u003c-eventcast.Listen(\"set\")\n      \u003c-eventcast.Listen(\"go\")\n      time.Sleep(time.Duration(rand.Intn(5000)) * time.Millisecond)\n      eventcast.BroadcastWithValue(\"finished\", i)\n    }(i)\n  }\n\n  // Allow some time for the pigs to get ready\n  \u003c-time.After(10 * time.Milisecond)\n\n  eventcast.Broadcast(\"ready\")\n  \u003c-time.After(1 * time.Second)\n\n  eventcast.Broadcast(\"set\")\n  \u003c-time.After(1 * time.Second)\n\n  eventcast.Broadcast(\"go\")\n  winner := \u003c-finished\n  fmt.Println(\"Winner is Pig\", winner.(int))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatedja%2Fgo-eventcast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatedja%2Fgo-eventcast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatedja%2Fgo-eventcast/lists"}