RxGo is the official ReactiveX implementation for the Go programming language, providing an API for asynchronous programming through Observable streams. Rather than relying on callbacks, promises, or deferred patterns, RxGo enables developers to process streams of events or items using a declarative, functional approach. The library implements ReactiveX concepts while leveraging Go's native primitives—channels and goroutines—to create a seamless integration between reactive programming patterns and Go's concurrency model.
The core architecture of RxGo is built on the concept of pipelines, where a series of stages are connected by channels, with each stage consisting of goroutines running the same function. Operators serve as transformation stages within these pipelines, defining how and when an Observable should emit data. The library provides a comprehensive set of operators for creating, transforming, filtering, and consuming data streams. By default, operators execute sequentially with a single goroutine instance per operator, but the library supports parallel execution through configurable goroutine pools, allowing developers to leverage modern multi-core CPU architectures for CPU-bound or IO-bound operations.
RxGo distinguishes between hot and cold Observables, reflecting where data is produced. Cold Observables generate data internally and create independent streams for each observer, making them suitable for scenarios like database queries. Hot Observables receive data from external sources and share that data across observers, ideal for use cases like trading price ticks or telemetry streams. The library also implements backpressure handling through strategies like blocking delivery or dropping items when the pipeline cannot keep pace with production.
The library supports multiple observation strategies. By default, Observables are lazy, emitting items only when subscribed to. Developers can switch to eager observation where operators process items immediately upon production, regardless of active observers. Connectable Observables provide additional control by deferring emission until an explicit connect() call is made, allowing all intended subscribers to register before data begins flowing.
RxGo v2 introduced significant changes from v1, including explicit item wrapping through Of(value) and Error(err) functions to prepare for future Go generics support. Items are wrappers around values or errors, and the library provides multiple consumption patterns: channel-based observation returning <-chan Item, callback-based consumption through ForEach with NextFunc, ErrFunc, and CompletedFunc, and non-blocking observation with notification channels.
According to GitGenius activity tracking, the repository shows median issue and pull request response latency of 22352.4 hours with a mean of 20567.4 hours across tracked items. The most active issue labels are question (4 occurrences), enhancement (2), and help needed (1). Primary contributors tracked include jochasinga with 3 events, HaveF with 2 events, and Alfex4936 with 1 event. The repository overlaps with contributors from major projects including microsoft/vscode, microsoft/typescript, and rust-lang/rust, indicating cross-pollination with significant open-source ecosystems.
The library supports Observable, Single, and Optional Single types through a common Iterable interface, accommodating different emission patterns. Documentation is available through the pkg.go.dev package reference, with additional resources covering the assert API for unit testing and detailed operator options. The project maintains an OpenCollective presence for community support and has recently resumed active maintainership under its original creator.