# dotnet/reactive architecture

> Architecture diagram of the GitHub repository dotnet/reactive, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dotnet/reactive
- Repository: https://github.com/dotnet/reactive

## Overview

This repository contains four related .NET sequence libraries; this graph focuses on AsyncRx.NET, the experimental async/await implementation of Rx. Its main workflow is to create or adapt an asynchronous observable, compose LINQ operators, and asynchronously subscribe to receive notifications. The graph also preserves scheduling, subjects, event/task bridges, join patterns, and virtual-time testing as distinct capabilities. Source excerpts are limited, so only directly evidenced relationships are solid; other plausible runtime links are omitted.

Main entry points: [`AsyncRx.NET/System.Reactive.Async/Linq/Operators/When.cs`](https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/Linq/Operators/When.cs) (Join coordination), [`AsyncRx.NET/System.Reactive.Async/Linq/Operators`](https://github.com/dotnet/reactive/tree/main/AsyncRx.NET/System.Reactive.Async/Linq/Operators) (LINQ operators), [`AsyncRx.NET/System.Reactive.Async/IAsyncObservable.cs`](https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/IAsyncObservable.cs) (Async contracts), [`AsyncRx.NET/System.Reactive.Async/Linq/Operators/FromAsync.cs`](https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/Linq/Operators/FromAsync.cs) (Task and event bridges)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Async stream core"]
  node_observable["Observable API<br/>[AsyncObservable.cs]"]
  node_contracts["Async contracts"]
  node_observers["Observer API<br/>[AsyncObserver.cs]"]
  node_subjects["Subjects<br/>[Subjects]"]
end

subgraph group_compose["Composition and joins"]
  node_operators["LINQ operators<br/>[Operators]"]
  node_when["Join coordination<br/>[When.cs]"]
  node_plans["Join plans<br/>[AsyncPlan.cs]"]
end

subgraph group_runtime["Execution support"]
  node_scheduler["Schedulers<br/>[AsyncScheduler.cs]"]
  node_disposables["Async disposal<br/>[AsyncDisposable.cs]"]
  node_bridges["Task and event bridges<br/>[FromAsync.cs]"]
  node_notifications["Notifications"]
end

subgraph group_testing["Virtual-time testing"]
  node_test_scheduler["Test scheduler"]
  node_test_observables["Timed test sources"]
  node_test_assertions["Test assertions"]
end

node_user(("Application code"))
node_external_events(("Async event sources"))
node_tasks(("Tasks"))

node_user -.->|"creates streams"| node_observable
node_observable -.->|"implements"| node_contracts
node_user -.->|"composes"| node_operators
node_operators -.->|"transforms"| node_contracts
node_user -.->|"subscribes"| node_observers
node_subjects -.->|"exposes streams"| node_contracts
node_when -->|"activates"| node_plans
node_when -->|"forwards notifications"| node_observers
node_when -->|"disposes joins"| node_disposables
node_operators -.->|"schedules work"| node_scheduler
node_bridges -.->|"adapts tasks"| node_tasks
node_bridges -.->|"adapts events"| node_external_events
node_test_observables -.->|"uses virtual time"| node_test_scheduler
node_user -.->|"verifies streams"| node_test_assertions

click node_observable "https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/AsyncObservable.cs"
click node_contracts "https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/IAsyncObservable.cs"
click node_observers "https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/AsyncObserver.cs"
click node_operators "https://github.com/dotnet/reactive/tree/main/AsyncRx.NET/System.Reactive.Async/Linq/Operators"
click node_when "https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/Linq/Operators/When.cs"
click node_plans "https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/Joins/AsyncPlan.cs"
click node_subjects "https://github.com/dotnet/reactive/tree/main/AsyncRx.NET/System.Reactive.Async/Subjects"
click node_scheduler "https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/Concurrency/AsyncScheduler.cs"
click node_disposables "https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/Disposables/AsyncDisposable.cs"
click node_bridges "https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/Linq/Operators/FromAsync.cs"
click node_notifications "https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/NotificationAsyncExtensions.cs"
click node_test_scheduler "https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/Microsoft.Reactive.Testing.Async/TestAsyncScheduler.cs"
click node_test_observables "https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/Microsoft.Reactive.Testing.Async/ColdAsyncObservable.cs"
click node_test_assertions "https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/Microsoft.Reactive.Testing.Async/AsyncReactiveAssert.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_observable,node_contracts,node_observers,node_subjects toneBlue
class node_operators,node_when,node_plans toneAmber
class node_scheduler,node_disposables,node_bridges,node_notifications toneMint
class node_test_scheduler,node_test_observables,node_test_assertions,node_tasks toneRose
class node_user,node_external_events toneIndigo
```

## Components

### Async stream core

- [Observable API](https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/AsyncObservable.cs): `AsyncRx.NET/System.Reactive.Async/AsyncObservable.cs`
- [Async contracts](https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/IAsyncObservable.cs): `AsyncRx.NET/System.Reactive.Async/IAsyncObservable.cs`
- [Observer API](https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/AsyncObserver.cs): `AsyncRx.NET/System.Reactive.Async/AsyncObserver.cs`
- [Subjects](https://github.com/dotnet/reactive/tree/main/AsyncRx.NET/System.Reactive.Async/Subjects): `AsyncRx.NET/System.Reactive.Async/Subjects`

### Composition and joins

- [LINQ operators](https://github.com/dotnet/reactive/tree/main/AsyncRx.NET/System.Reactive.Async/Linq/Operators): `AsyncRx.NET/System.Reactive.Async/Linq/Operators`
- [Join coordination](https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/Linq/Operators/When.cs): `AsyncRx.NET/System.Reactive.Async/Linq/Operators/When.cs`
- [Join plans](https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/Joins/AsyncPlan.cs): `AsyncRx.NET/System.Reactive.Async/Joins/AsyncPlan.cs`

### Execution support

- [Schedulers](https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/Concurrency/AsyncScheduler.cs): `AsyncRx.NET/System.Reactive.Async/Concurrency/AsyncScheduler.cs`
- [Async disposal](https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/Disposables/AsyncDisposable.cs): `AsyncRx.NET/System.Reactive.Async/Disposables/AsyncDisposable.cs`
- [Task and event bridges](https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/Linq/Operators/FromAsync.cs): `AsyncRx.NET/System.Reactive.Async/Linq/Operators/FromAsync.cs`
- [Notifications](https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/System.Reactive.Async/NotificationAsyncExtensions.cs): `AsyncRx.NET/System.Reactive.Async/NotificationAsyncExtensions.cs`

### Virtual-time testing

- [Test scheduler](https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/Microsoft.Reactive.Testing.Async/TestAsyncScheduler.cs): `AsyncRx.NET/Microsoft.Reactive.Testing.Async/TestAsyncScheduler.cs`
- [Timed test sources](https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/Microsoft.Reactive.Testing.Async/ColdAsyncObservable.cs): `AsyncRx.NET/Microsoft.Reactive.Testing.Async/ColdAsyncObservable.cs`
- [Test assertions](https://github.com/dotnet/reactive/blob/main/AsyncRx.NET/Microsoft.Reactive.Testing.Async/AsyncReactiveAssert.cs): `AsyncRx.NET/Microsoft.Reactive.Testing.Async/AsyncReactiveAssert.cs`

### Other components

- **Application code**
- **Async event sources**
- **Tasks**

## Connections

- Application code → Observable API: creates streams
- Observable API → Async contracts: implements
- Application code → LINQ operators: composes
- LINQ operators → Async contracts: transforms (evidence: `AsyncRx.NET/System.Reactive.Async/Linq/Operators/When.cs`)
- Application code → Observer API: subscribes
- Subjects → Async contracts: exposes streams
- Join coordination → Join plans: activates (evidence: `AsyncRx.NET/System.Reactive.Async/Linq/Operators/When.cs`)
- Join coordination → Observer API: forwards notifications (evidence: `AsyncRx.NET/System.Reactive.Async/Linq/Operators/When.cs`)
- Join coordination → Async disposal: disposes joins (evidence: `AsyncRx.NET/System.Reactive.Async/Linq/Operators/When.cs`)
- LINQ operators → Schedulers: schedules work
- Task and event bridges → Tasks: adapts tasks
- Task and event bridges → Async event sources: adapts events
- Timed test sources → Test scheduler: uses virtual time
- Application code → Test assertions: verifies streams
