rx-observables

Guide System.Reactive (Rx.NET) patterns and best practices in C#.

2.1k|36|Updated Feb 4, 2021
One-click install
npx skills add https://github.com/recyclarr/recyclarr --skill rx-observables
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rx-observables
Source: https://github.com/recyclarr/recyclarr/tree/main/.opencode/skills/rx-observables
Command: npx skills add https://github.com/recyclarr/recyclarr --skill rx-observables

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides guidance on writing and modifying code that uses System.Reactive (Rx.NET), helping developers avoid common pitfalls and write more robust, maintainable reactive code.

Core Features & Use Cases

  • Rx.NET Best Practices: Covers interface design, subject usage, subscription lifecycle management, and error handling.
  • Patterns and Anti-patterns: Clearly outlines recommended approaches and common mistakes to avoid.
  • Use Case: When refactoring a legacy event-driven system to use Rx.NET, consult this Skill to ensure proper subject selection, subscription disposal, and error handling strategies are implemented.

Quick Start

Use the rx-observables skill to understand how to properly expose IObservable<T> from a class.

Frequently Asked Questions about rx-observables

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

FAQPage Schema
How do I properly expose IObservable<T> from a C# class using Rx.NET?

To expose IObservable<T> from a C# class using Rx.NET, return an observable sequence directly or via a subject. This ensures correct interface design and encapsulates observable patterns for robust reactive programming implementations.

What is the best way to manage the subscription lifecycle in reactive programming with C#?

Managing the subscription lifecycle in reactive programming requires proper disposal of subscriptions to prevent memory leaks. This skill outlines subscription management best practices, ensuring correct System.Reactive lifecycle handling.

How do I select the right Rx.NET subject for my observable pattern?

Selecting the right Rx.NET subject depends on your specific event broadcast needs. This skill addresses subject selection strategies and anti-patterns, ensuring you choose the correct subject type for your reactive pattern.

How do I handle errors in System.Reactive observables without breaking the stream?

Handling errors in System.Reactive observables requires proper error handling strategies to prevent stream termination. This skill provides guidance on Rx.NET error handling patterns to ensure robust and maintainable application development.

Can I use Rx.NET patterns for refactoring legacy event-driven systems in C#?

You can use Rx.NET patterns to refactor legacy event-driven systems in C# by converting existing events to observables. This skill ensures proper subject selection, subscription disposal, and error handling strategies are implemented correctly.

Why does my Rx.NET subscription cause memory leaks in C#?

Rx.NET subscriptions cause memory leaks in C# when observables are not properly disposed. This skill outlines subscription lifecycle management best practices and anti-patterns to help developers avoid common reactive programming pitfalls.