go-samber-ro

Build reactive streams and event-driven pipelines in Go using samber/ro operators.

1|2|Updated Nov 25, 2017
One-click install
npx skills add https://github.com/asarchami/dotfiles --skill go-samber-ro-asarchami
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-samber-ro
Source: https://github.com/asarchami/dotfiles/tree/main/dot_claude/skills/go-samber-ro
Command: npx skills add https://github.com/asarchami/dotfiles --skill go-samber-ro-asarchami

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires github.com/samber/ro, and includes references (resource) components.

What problem does it solve? Manual goroutine and channel wiring in Go becomes unwieldy for complex asynchronous pipelines, with verbose lifecycle management, error propagation across nested selects, and no composable operators. This Skill guides you to build declarative, type-safe reactive streams with samber/ro instead. ## Core Features & Use Cases - 150+ Type-Safe Operators: Compose Map, Filter, FlatMap, Merge, Zip, CombineLatest, Retry, Timeout, and more via typed Pipe2–Pipe25 chains with compile-time checking. - Cold/Hot Observables & 5 Subject Types: Choose Publish, Behavior, Replay, Async, or Unicast subjects, or convert cold streams with Share and ShareReplay for multicasting. - 40+ Plugin Ecosystem: Extend pipelines with HTTP, cron, fsnotify, JSON encoding, structured logging (Zap, Slog, Zerolog), rate limiting, and OS signal handling. - Use Case: Wrap a remote API call with Timeout, RetryWithConfig exponential backoff, and a Catch fallback to a cached source — all in a few declarative lines instead of manual retry loops. ## Quick Start Ask the AI to build a reactive pipeline in Go using samber/ro, for example a file watcher that debounces change events and reloads configuration with retry and timeout handling.

Frequently Asked Questions about go-samber-ro

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a reactive stream pipeline in Go with samber/ro?

Create an observable with operators like Just, FromSlice, or RangeWithInterval, then chain transformations using typed Pipe2 through Pipe25 functions with operators like Map, Filter, and FlatMap. Subscribe with NewObserver handling onNext, onError, and onComplete, or use Collect for synchronous slice results.

When should I use samber/ro vs samber/lo in Go?

Use samber/lo for finite slice transforms like Map, Filter, and Reduce on data already in memory — it is synchronous and eager. Use samber/ro when data arrives over time from infinite streams, multiple async sources, or when you need retry, timeout, backpressure, and stream combination.

What is the difference between cold and hot observables in samber/ro?

Cold observables start an independent execution for each subscriber and are the default. Hot observables share one execution across subscribers, created via Share, ShareReplay, Connectable, or natively hot subjects like PublishSubject and BehaviorSubject.

Which subject type should I use in samber/ro?

Use PublishSubject for event broadcasting without history, BehaviorSubject when subscribers need the current state, ReplaySubject to replay the last N values, AsyncSubject for only the final value on completion, and UnicastSubject for exactly one buffered consumer.

Why does my samber/ro stream leak goroutines?

Infinite streams without termination conditions keep running forever. Bound them with Take(n), TakeUntil(signal), Timeout(d), or context cancellation via ThrowOnContextCancel, and call Unsubscribe on subscriptions you no longer need.

How do I add retry and timeout to a remote call with samber/ro?

Chain Timeout with a duration, then RetryWithConfig specifying max attempts, delay, and backoff multiplier, and finally Catch to fall back to an alternative observable like a cache. This replaces manual retry loops with declarative operators.