Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,15 @@ because they're style, not perf.
operator we ship (`Select`, `Where`, `CombineLatest`, `Merge`,
`Throttle`, `Scan`, etc.) is **our own implementation** under
`Operators/` (sync) or `Async/Operators/` (async).
- **`IScheduler` and `Unit` are unavoidable parts of Rx — do not try to
replace them.** `IScheduler` is the canonical scheduling abstraction the
entire Rx ecosystem (and our `IObservable<T>` consumers) interop through;
rolling our own scheduler interface would fragment that contract for zero
benefit. `Unit` is the standard "no value" token every Rx signal stream
uses. Both are foundational BCL-level contracts: depend on them directly,
pass them through, and don't author parallel substitutes. This is the one
place the "don't rebadge" rule inverts — here the *right* move is to reuse
the `System.Reactive` type, not replace it.
- **`System.Reactive.Linq.Observable.*` is banned in production code
paths** outside thin BCL bridges. If a feature feels like it needs
`Observable.Foo`, add our own operator with the allocation profile we
Expand Down
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ but keep the style and pattern-matching rules.
our own implementation** — `Select`, `Where`, `CombineLatest`,
`Merge`, `Throttle`, `Scan`, etc. No `System.Reactive.Linq.Observable`
in production code paths outside thin bridges.
- **`IScheduler` and `Unit` are unavoidable parts of Rx — never replace
them.** `IScheduler` is the scheduling abstraction the whole Rx
ecosystem interops through, and `Unit` is the standard "no value" token
for signal streams. Authoring parallel substitutes would fragment the
contract our `IObservable<T>` consumers rely on, for no gain. Depend on
both directly and pass them through. This is the deliberate exception to
the "don't rebadge" rule below: for these two types the correct move is
to reuse the `System.Reactive` type, not reinvent it.
- **Don't rebadge `System.Reactive` types 1:1.** Our replacements must
be tailored, low-allocation, perf-focused, and only as
thread-aware-as-needed. A `SubjectAsync<T>` that mirrors `Subject<T>`
Expand Down
Loading
Loading