{"id":23129041,"url":"https://github.com/twiny/flare","last_synced_at":"2025-04-04T06:25:31.778Z","repository":{"id":192600418,"uuid":"681262505","full_name":"twiny/flare","owner":"twiny","description":"A lightweight signaling mechanism for Go.","archived":false,"fork":false,"pushed_at":"2024-02-23T19:20:48.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T17:42:37.747Z","etag":null,"topics":["golang"],"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/twiny.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}},"created_at":"2023-08-21T16:15:46.000Z","updated_at":"2023-09-03T21:12:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"265b6394-ac86-4ad4-90dd-1626802880c1","html_url":"https://github.com/twiny/flare","commit_stats":null,"previous_names":["twiny/flare"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twiny%2Fflare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twiny%2Fflare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twiny%2Fflare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twiny%2Fflare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twiny","download_url":"https://codeload.github.com/twiny/flare/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247130931,"owners_count":20888681,"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":["golang"],"created_at":"2024-12-17T10:08:10.001Z","updated_at":"2025-04-04T06:25:31.756Z","avatar_url":"https://github.com/twiny.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flare 🚀\n\nA simple, lightweight signaling mechanism in Go.\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/twiny/flare)](https://goreportcard.com/report/github.com/twiny/flare)\n[![GoDoc](https://godoc.org/github.com/twiny/flare?status.svg)](https://pkg.go.dev/github.com/twiny/flare)\n\n---\n\n## Introduction\n\nFlare provides an alternative to the standard context package in Go for signaling goroutines, without carrying cancellation info or other values. It's a minimalistic tool designed to provide a straightforward mechanism to signal goroutines to stop their work.\n\n## Installation\n\n```bash\ngo get github.com/twiny/flare\n```\n\n## Usage\n\n### Basic Usage\n\n```go\npackage main\n\nimport (\n \"github.com/twiny/flare\"\n)\n\nfunc main() {\n n := flare.NewNotifier()\n\n // Spawn a goroutine\n go func() {\n  select {\n  case \u003c-n.Hold():\n   return\n  default:\n   // Do some work\n  }\n }()\n\n // Signal the goroutine to stop\n n.Signal()\n}\n```\n\n### Integration with context.Context\n\n```go\nfunc main() {\n n, cancel := flare.NewNotifierWithCancel(context.Background())\n // Canceling the context will also signal the flare Notifier.\n defer cancel()\n\n // Spawn a goroutine\n go func() {\n  select {\n  case \u003c-n.Hold():\n   return\n  default:\n   // Do some work\n  }\n }()\n\n // Signal the goroutine to stop\n n.Signal()\n}\n```\n\n## Wiki\n\nMore documentation can be found in the [wiki](https://github.com/twiny/flare/wiki).\n\n## Bugs\n\nBugs or suggestions? Please visit the [issue tracker](https://github.com/twiny/flare/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwiny%2Fflare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwiny%2Fflare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwiny%2Fflare/lists"}