{"id":18456124,"url":"https://github.com/jjeffcaii/reactor-go","last_synced_at":"2025-04-06T07:11:33.941Z","repository":{"id":35125286,"uuid":"174316781","full_name":"jjeffcaii/reactor-go","owner":"jjeffcaii","description":"A golang implementation for reactive-streams.","archived":false,"fork":false,"pushed_at":"2025-03-17T02:34:28.000Z","size":402,"stargazers_count":67,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T05:09:44.912Z","etag":null,"topics":["go","golang","reactive-stream","reactive-streams","reactivex","reactor","rxgo","rxjava"],"latest_commit_sha":null,"homepage":"https://jjeffcaii.github.io/reactor-go","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/jjeffcaii.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":"2019-03-07T09:48:31.000Z","updated_at":"2025-02-12T06:38:05.000Z","dependencies_parsed_at":"2025-02-25T04:00:30.461Z","dependency_job_id":"a065ef67-83ca-4d12-8519-acc7a10d3c5b","html_url":"https://github.com/jjeffcaii/reactor-go","commit_stats":null,"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjeffcaii%2Freactor-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjeffcaii%2Freactor-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjeffcaii%2Freactor-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjeffcaii%2Freactor-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jjeffcaii","download_url":"https://codeload.github.com/jjeffcaii/reactor-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445670,"owners_count":20939958,"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":["go","golang","reactive-stream","reactive-streams","reactivex","reactor","rxgo","rxjava"],"created_at":"2024-11-06T08:10:17.433Z","updated_at":"2025-04-06T07:11:33.915Z","avatar_url":"https://github.com/jjeffcaii.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# reactor-go 🚀🚀🚀\n\n![GitHub Workflow Status](https://github.com/jjeffcaii/reactor-go/workflows/Go/badge.svg)\n[![codecov](https://codecov.io/gh/jjeffcaii/reactor-go/branch/master/graph/badge.svg)](https://codecov.io/gh/jjeffcaii/reactor-go)\n[![GoDoc](https://godoc.org/github.com/jjeffcaii/reactor-go?status.svg)](https://godoc.org/github.com/jjeffcaii/reactor-go)\n[![Go Report Card](https://goreportcard.com/badge/github.com/jjeffcaii/reactor-go)](https://goreportcard.com/report/github.com/jjeffcaii/reactor-go)\n[![License](https://img.shields.io/github/license/jjeffcaii/reactor-go.svg)](https://github.com/jjeffcaii/reactor-go/blob/master/LICENSE)\n[![GitHub Release](https://img.shields.io/github/release-pre/jjeffcaii/reactor-go.svg)](https://github.com/jjeffcaii/reactor-go/releases)\n\n\u003e A golang implementation for [reactive-streams](https://www.reactive-streams.org/).\n\n## Install\n\n```sh\ngo get -u github.com/jjeffcaii/reactor-go\n```\n\n## Example\n\n### Mono\n```go\npackage mono_test\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/jjeffcaii/reactor-go\"\n\t\"github.com/jjeffcaii/reactor-go/mono\"\n)\n\nfunc Example() {\n\tgen := func(ctx context.Context, sink mono.Sink) {\n\t\tsink.Success(\"World\")\n\t}\n\tmono.\n\t\tCreate(gen).\n\t\tMap(func(input reactor.Any) (output reactor.Any, err error) {\n\t\t\toutput = \"Hello \" + input.(string) + \"!\"\n\t\t\treturn\n\t\t}).\n\t\tDoOnNext(func(v reactor.Any) error {\n\t\t\tfmt.Println(v)\n\t\t\treturn nil\n\t\t}).\n\t\tSubscribe(context.Background())\n}\n\n// Should print\n// Hello World!\n\n```\n\n### Flux\n```go\npackage flux_test\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/jjeffcaii/reactor-go\"\n\t\"github.com/jjeffcaii/reactor-go/flux\"\n\t\"github.com/jjeffcaii/reactor-go/scheduler\"\n)\n\nfunc Example() {\n\tgen := func(ctx context.Context, sink flux.Sink) {\n\t\tfor i := 0; i \u003c 10; i++ {\n\t\t\tv := i\n\t\t\tsink.Next(v)\n\t\t}\n\t\tsink.Complete()\n\t}\n\tdone := make(chan struct{})\n\n\tvar su reactor.Subscription\n\tflux.Create(gen).\n\t\tFilter(func(i interface{}) bool {\n\t\t\treturn i.(int)%2 == 0\n\t\t}).\n\t\tMap(func(input reactor.Any) (output reactor.Any, err error) {\n\t\t\toutput = fmt.Sprintf(\"#HELLO_%04d\", input.(int))\n\t\t\treturn\n\t\t}).\n\t\tSubscribeOn(scheduler.Elastic()).\n\t\tSubscribe(context.Background(),\n\t\t\treactor.OnSubscribe(func(s reactor.Subscription) {\n\t\t\t\tsu = s\n\t\t\t\ts.Request(1)\n\t\t\t}),\n\t\t\treactor.OnNext(func(v reactor.Any) error {\n\t\t\t\tfmt.Println(\"next:\", v)\n\t\t\t\tsu.Request(1)\n\t\t\t\treturn nil\n\t\t\t}),\n\t\t\treactor.OnComplete(func() {\n\t\t\t\tclose(done)\n\t\t\t}),\n\t\t)\n\t\u003c-done\n}\n// Should print:\n// next: #HELLO_0000\n// next: #HELLO_0002\n// next: #HELLO_0004\n// next: #HELLO_0006\n// next: #HELLO_0008\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjeffcaii%2Freactor-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjjeffcaii%2Freactor-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjeffcaii%2Freactor-go/lists"}