{"id":34151995,"url":"https://github.com/b97tsk/rx","last_synced_at":"2026-01-11T22:50:50.865Z","repository":{"id":38410409,"uuid":"129774053","full_name":"b97tsk/rx","owner":"b97tsk","description":"A reactive programming library for Go, inspired by https://reactivex.io/ (mostly RxJS).","archived":false,"fork":false,"pushed_at":"2024-08-15T09:27:44.000Z","size":1811,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-14T17:52:15.686Z","etag":null,"topics":["generics","go","golang","reactive","reactive-programming","rxgo"],"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/b97tsk.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}},"created_at":"2018-04-16T16:31:33.000Z","updated_at":"2025-06-28T07:41:39.000Z","dependencies_parsed_at":"2024-02-21T08:26:53.686Z","dependency_job_id":"0adfefbe-8932-4319-b568-9f3d75d3797a","html_url":"https://github.com/b97tsk/rx","commit_stats":null,"previous_names":["b97tsk/observable","b97tsk/rxgo"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/b97tsk/rx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b97tsk%2Frx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b97tsk%2Frx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b97tsk%2Frx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b97tsk%2Frx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b97tsk","download_url":"https://codeload.github.com/b97tsk/rx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b97tsk%2Frx/sbom","scorecard":{"id":222195,"data":{"date":"2025-08-11","repo":{"name":"github.com/b97tsk/rx","commit":"97d7c1db40a7acac23278309c7f75a2c7b5fe201"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/8 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T02:50:11.793Z","repository_id":38410409,"created_at":"2025-08-17T02:50:11.793Z","updated_at":"2025-08-17T02:50:11.793Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27744841,"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","status":"online","status_checked_at":"2025-12-15T02:00:09.782Z","response_time":96,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["generics","go","golang","reactive","reactive-programming","rxgo"],"created_at":"2025-12-15T05:49:31.499Z","updated_at":"2025-12-15T05:49:36.082Z","avatar_url":"https://github.com/b97tsk.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rx\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/b97tsk/rx.svg)](https://pkg.go.dev/github.com/b97tsk/rx)\n[![Build Status](https://github.com/b97tsk/rx/actions/workflows/build.yml/badge.svg?branch=generics)](https://github.com/b97tsk/rx/actions/workflows/build.yml)\n[![Coverage Status](https://coveralls.io/repos/github/b97tsk/rx/badge.svg?branch=generics)](https://coveralls.io/github/b97tsk/rx?branch=generics)\n\nA reactive programming library for Go, inspired by https://reactivex.io/ (mostly RxJS).\n\nThe code is in [another branch](https://github.com/b97tsk/rx/tree/generics).\n\nFuture updates are not guaranteed.\n\n## Examples\n\n[example_test.go](https://github.com/b97tsk/rx/blob/generics/example_test.go)\n\n```go\n// Create an Observable...\nob := rx.Range(1, 10)\n\n// ...and apply some Operators.\nob = rx.Pipe3(\n\tob,\n\trx.Filter(\n\t\tfunc(v int) bool {\n\t\t\treturn v%2 == 1\n\t\t},\n\t),\n\trx.Map(\n\t\tfunc(v int) int {\n\t\t\treturn v * 2\n\t\t},\n\t),\n\trx.Do(\n\t\tfunc(n rx.Notification[int]) {\n\t\t\tswitch n.Kind {\n\t\t\tcase rx.KindNext:\n\t\t\t\tfmt.Println(n.Value)\n\t\t\tcase rx.KindComplete:\n\t\t\t\tfmt.Println(\"Complete\")\n\t\t\tcase rx.KindError:\n\t\t\t\tfmt.Println(\"Error:\", n.Error)\n\t\t\tcase rx.KindStop:\n\t\t\t\tfmt.Println(\"Stop:\", n.Error)\n\t\t\t}\n\t\t},\n\t),\n)\n\n// To Subscribe to an Observable, you call its Subscribe method, which takes\n// a Context and an Observer as arguments.\nob.Subscribe(rx.NewContext(context.TODO()), rx.Noop[int])\n\n// Since this example has no other goroutines involved, it must have already done.\n// You can also use BlockingSubscribe method instead. It blocks until done.\n\n// Output:\n// 2\n// 6\n// 10\n// 14\n// 18\n// Complete\n```\n\n```go\nctx, cancel := rx.NewContext(context.TODO()).WithTimeout(700 * time.Millisecond)\ndefer cancel()\n\nob := rx.Pipe4(\n\trx.Concat(\n\t\trx.Timer(50*time.Millisecond),\n\t\trx.Ticker(100*time.Millisecond),\n\t),\n\trx.Scan(-1, func(i int, _ time.Time) int { return i + 1 }), // 0, 1, 2, 3, ...\n\trx.Scan(0, func(v1, v2 int) int { return v1 + v2 }),        // 0, 1, 3, 6, ...\n\trx.Skip[int](4),\n\trx.DoOnNext(func(v int) { fmt.Println(v) }), // 10, 15, 21, ...\n)\n\nswitch n := ob.BlockingSubscribe(ctx, rx.Noop[int]); n.Kind {\ncase rx.KindComplete:\n\tfmt.Println(\"Complete\")\ncase rx.KindError:\n\tfmt.Println(\"Error:\", n.Error)\ncase rx.KindStop:\n\tfmt.Println(\"Stop:\", n.Error)\n}\n\n// Output:\n// 10\n// 15\n// 21\n// Stop: context deadline exceeded\n```\n\n```go\nctx := rx.NewContext(context.TODO()).WithNewWaitGroup()\n\nctx.Go(func() {\n\tfor n := 1; n \u003c= 3; n++ {\n\t\trx.Pipe2(\n\t\t\trx.Timer(50*time.Millisecond*time.Duration(n)),\n\t\t\trx.MapTo[time.Time](n),\n\t\t\trx.DoOnNext(func(v int) { fmt.Println(v) }),\n\t\t).Subscribe(ctx, rx.Noop[int])\n\t}\n})\n\nctx.Wait()\n\n// Output:\n// 1\n// 2\n// 3\n```\n\n```go\n// Multicasts and Unicasts are special Observables that developers can decide\n// what values they produce or when they complete, later after they are subscribed.\n// Multicasts can be subscribed multiple times, whereas Unicasts can only be\n// successfully subscribed once.\n// Both Multicasts and Unicasts are safe for concurrent use.\n// Here is an example demonstrates how to use a Unicast.\n\nctx := rx.NewContext(context.TODO()).WithNewWaitGroup()\n\nu := rx.Unicast[time.Time]()\n\nctx.Go(func() {\n\trx.Pipe2(\n\t\trx.Concat(\n\t\t\tu.Observable,\n\t\t\trx.Timer(500*time.Millisecond),\n\t\t),\n\t\trx.MapTo[time.Time](42),\n\t\trx.Do(\n\t\t\tfunc(n rx.Notification[int]) {\n\t\t\t\tswitch n.Kind {\n\t\t\t\tcase rx.KindNext:\n\t\t\t\t\tfmt.Println(n.Value)\n\t\t\t\tcase rx.KindComplete:\n\t\t\t\t\tfmt.Println(\"Complete\")\n\t\t\t\tcase rx.KindError:\n\t\t\t\t\tfmt.Println(\"Error:\", n.Error)\n\t\t\t\tcase rx.KindStop:\n\t\t\t\t\tfmt.Println(\"Stop:\", n.Error)\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t).Subscribe(ctx, rx.Noop[int])\n})\n\nctx.Go(func() {\n\tu.Complete() // Start timer.\n})\n\nctx.Wait()\n\n// This example works properly, no matter which ctx.Go(...) runs first.\n\n// Output:\n// 42\n// Complete\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb97tsk%2Frx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb97tsk%2Frx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb97tsk%2Frx/lists"}