๐๏ธ Streams & Reactive Programming paradigm for Go: declarative and composable API for event-driven applications
683
stars
206
commits
Go
primary language
Sep 10, 2026
updated
A Go implementation of the ReactiveX spec.
The purpose of Reactive Programming is to simplify the development of event-driven and asynchronous applications by providing a declarative and composable way to handle streams of data or events.

See also:
What makes it different from samber/lo?
Reactive Programming is focused on handling asynchronous data streams where values (like user input, API responses, or sensor data) are emitted over time. Instead of pulling data or waiting for events manually, you react to changes as they occur using Observable, Observer, and Operator. This approach simplifies building systems that are responsive, resilient, and scalable, especially in event-driven or real-time applications.
observable := ro.Pipe(
ro.RangeWithInterval(0, 5, 1*time.Second),
ro.Filter(func(x int) bool {
return x%2 == 0
}),
ro.Map(func(x int) string {
return fmt.Sprintf("even-%d", x)
}),
)
// Start consuming on subscription
observable.Subscribe(ro.NewObserver(
func(s string) { fmt.Println(s) },
func(err error) { fmt.Println(err.Error()) },
func() { fmt.Println("Completed!") }
))
// Output:
// "even-0"
// "even-2"
// "even-4"
// "Completed!"
// or:
values, err := ro.Collect(observable)
// []string{"even-0", "even-2", "even-4"}
// <nil>
Now you discovered the paradigm, follow the documentation and turn reactive: ๐ Getting started
go get github.com/samber/ro
# AI Agent Skill
npx skills add https://github.com/samber/cc-skills-golang --skill golang-samber-ro
This library is v0 and follows SemVer strictly.
Some breaking changes might be made to exported APIs before v1.0.0. Experimental packages under exp/ are considered as unstable.
This library has minimal dependencies outside the Go standard library.
The ro library provides all basic operators:
ro.PipeObservableObservableObservableObservable into oneObservableThe ro library provides a rich ecosystem of plugins for various use cases:
plugins/bytes) - String and byte slice manipulation operatorsplugins/strings) - String manipulation operatorsplugins/sort) - Sorting operatorsplugins/strconv) - String conversion operatorsplugins/exp/simd) - SIMD-accelerated transformationsplugins/encoding/json) - JSON marshaling and unmarshalingplugins/encoding/csv) - CSV reading and writingplugins/encoding/base64) - Base64 encoding and decodingplugins/encoding/gob) - Go binary serializationplugins/cron) - Schedule jobs using cron expressions or duration intervalsplugins/ics) - Read and parse ICS/iCal calendarsplugins/http) - HTTP request operatorsplugins/io) - File and stream I/O operatorsplugins/fsnotify) - File system monitoring operatorsplugins/observability/log) - Standard logging operatorsplugins/observability/zap) - Structured logging with zapplugins/observability/logrus) - Structured logging with logrusplugins/observability/slog) - Structured logging with slogplugins/observability/zerolog) - Structured logging with zerologplugins/observability/sentry) - Error tracking with Sentryplugins/samber/oops) - Structured error handlingplugins/ratelimit/native) - Native rate limiting operatorsplugins/ratelimit/ulule) - Rate limiting with ulule/limiterplugins/regexp) - Regular expression operatorsplugins/template) - Template processing operatorsplugins/proc) - Process execution operatorsplugins/signal) - Signal handling operatorsplugins/iter) - Iterator operatorsplugins/samber/psi) - Starvation notifierplugins/ozzo/ozzo-validation) - Data validation operatorsplugins/testify) - Testing utilitiesplugins/hyperloglog) - Cardinality estimation operatorsplugins/samber/hot) - In-memory cacheSee the examples directory for complete working examples:
Check the contribution guide.
Don't hesitate ;)
Give a โญ๏ธ if this project helped you!
Copyright ยฉ 2025 Samuel Berthe.
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Note: The ee/ directory contains the Enterprise Edition of the library, which is subject to a custom license. Please refer to the ee/LICENSE.md file for the specific terms and conditions applicable to the Enterprise Edition.
Go
99.9%
๐๏ธ Streams & Reactive Programming paradigm for Go: declarative and composable API for event-driven applications
683
stars
206
commits
Go
primary language
Sep 10, 2026
updated
A Go implementation of the ReactiveX spec.
The purpose of Reactive Programming is to simplify the development of event-driven and asynchronous applications by providing a declarative and composable way to handle streams of data or events.

See also:
What makes it different from samber/lo?
Reactive Programming is focused on handling asynchronous data streams where values (like user input, API responses, or sensor data) are emitted over time. Instead of pulling data or waiting for events manually, you react to changes as they occur using Observable, Observer, and Operator. This approach simplifies building systems that are responsive, resilient, and scalable, especially in event-driven or real-time applications.
observable := ro.Pipe(
ro.RangeWithInterval(0, 5, 1*time.Second),
ro.Filter(func(x int) bool {
return x%2 == 0
}),
ro.Map(func(x int) string {
return fmt.Sprintf("even-%d", x)
}),
)
// Start consuming on subscription
observable.Subscribe(ro.NewObserver(
func(s string) { fmt.Println(s) },
func(err error) { fmt.Println(err.Error()) },
func() { fmt.Println("Completed!") }
))
// Output:
// "even-0"
// "even-2"
// "even-4"
// "Completed!"
// or:
values, err := ro.Collect(observable)
// []string{"even-0", "even-2", "even-4"}
// <nil>
Now you discovered the paradigm, follow the documentation and turn reactive: ๐ Getting started
go get github.com/samber/ro
# AI Agent Skill
npx skills add https://github.com/samber/cc-skills-golang --skill golang-samber-ro
This library is v0 and follows SemVer strictly.
Some breaking changes might be made to exported APIs before v1.0.0. Experimental packages under exp/ are considered as unstable.
This library has minimal dependencies outside the Go standard library.
The ro library provides all basic operators:
ro.PipeObservableObservableObservableObservable into oneObservableThe ro library provides a rich ecosystem of plugins for various use cases:
plugins/bytes) - String and byte slice manipulation operatorsplugins/strings) - String manipulation operatorsplugins/sort) - Sorting operatorsplugins/strconv) - String conversion operatorsplugins/exp/simd) - SIMD-accelerated transformationsplugins/encoding/json) - JSON marshaling and unmarshalingplugins/encoding/csv) - CSV reading and writingplugins/encoding/base64) - Base64 encoding and decodingplugins/encoding/gob) - Go binary serializationplugins/cron) - Schedule jobs using cron expressions or duration intervalsplugins/ics) - Read and parse ICS/iCal calendarsplugins/http) - HTTP request operatorsplugins/io) - File and stream I/O operatorsplugins/fsnotify) - File system monitoring operatorsplugins/observability/log) - Standard logging operatorsplugins/observability/zap) - Structured logging with zapplugins/observability/logrus) - Structured logging with logrusplugins/observability/slog) - Structured logging with slogplugins/observability/zerolog) - Structured logging with zerologplugins/observability/sentry) - Error tracking with Sentryplugins/samber/oops) - Structured error handlingplugins/ratelimit/native) - Native rate limiting operatorsplugins/ratelimit/ulule) - Rate limiting with ulule/limiterplugins/regexp) - Regular expression operatorsplugins/template) - Template processing operatorsplugins/proc) - Process execution operatorsplugins/signal) - Signal handling operatorsplugins/iter) - Iterator operatorsplugins/samber/psi) - Starvation notifierplugins/ozzo/ozzo-validation) - Data validation operatorsplugins/testify) - Testing utilitiesplugins/hyperloglog) - Cardinality estimation operatorsplugins/samber/hot) - In-memory cacheSee the examples directory for complete working examples:
Check the contribution guide.
Don't hesitate ;)
Give a โญ๏ธ if this project helped you!
Copyright ยฉ 2025 Samuel Berthe.
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Note: The ee/ directory contains the Enterprise Edition of the library, which is subject to a custom license. Please refer to the ee/LICENSE.md file for the specific terms and conditions applicable to the Enterprise Edition.
Go
99.9%