Prognosis.Reactive
2.1.0
dotnet add package Prognosis.Reactive --version 2.1.0
NuGet\Install-Package Prognosis.Reactive -Version 2.1.0
<PackageReference Include="Prognosis.Reactive" Version="2.1.0" />
<PackageVersion Include="Prognosis.Reactive" Version="2.1.0" />
<PackageReference Include="Prognosis.Reactive" />
paket add Prognosis.Reactive --version 2.1.0
#r "nuget: Prognosis.Reactive, 2.1.0"
#:package Prognosis.Reactive@2.1.0
#addin nuget:?package=Prognosis.Reactive&version=2.1.0
#tool nuget:?package=Prognosis.Reactive&version=2.1.0
Prognosis.Reactive
System.Reactive extensions for the Prognosis service health graph. Provides Rx-based alternatives to the polling-based HealthMonitor in the core package.
Installation
dotnet add package Prognosis.Reactive
API
PollHealthReport — timer-driven polling
Polls the full health graph on a fixed interval, notifying all observable services and emitting a HealthReport whenever the graph state changes:
using Prognosis.Reactive;
var roots = new IServiceHealth[] { app };
roots.PollHealthReport(TimeSpan.FromSeconds(30))
.Subscribe(report =>
Console.WriteLine($"Overall: {report.OverallStatus}"));
ObserveHealthReport — push-triggered evaluation
Reacts to StatusChanged events from leaf nodes (services with no dependencies), throttles to avoid evaluation storms, then runs a single-pass graph evaluation:
roots.ObserveHealthReport(TimeSpan.FromMilliseconds(500))
.Subscribe(report =>
Console.WriteLine($"Overall: {report.OverallStatus}"));
Only leaf nodes are observed as triggers since parent status changes are always a consequence of HealthAggregator.NotifyGraph, not exogenous events.
SelectServiceChanges — diff-based change stream
Projects consecutive HealthReport emissions into individual ServiceStatusChange events by diffing the reports. Composable with any report source:
roots.PollHealthReport(TimeSpan.FromSeconds(30))
.SelectServiceChanges()
.Subscribe(change =>
Console.WriteLine($"{change.Name}: {change.Previous} → {change.Current}"));
Each ServiceStatusChange includes the service name, previous status, current status, and optional reason — derived from HealthAggregator.Diff in the core library.
Sharing patterns
The Rx helpers in this package produce cold IObservable<HealthReport> streams — each subscription runs an independent pipeline and triggers its own evaluations. To avoid duplicate work across multiple subscribers, multicast the stream with one of the common patterns:
- Auto-start while there are subscribers (stop when last unsubscribes):
var shared = roots.ObserveHealthReport(TimeSpan.FromMilliseconds(500))
.Publish()
.RefCount();
shared.Subscribe(...);
shared.Subscribe(...);
- Replay the latest report to late subscribers:
var shared = roots.ObserveHealthReport(TimeSpan.FromMilliseconds(500))
.Replay(1)
.RefCount();
shared.Subscribe(...); // immediate get latest
If you prefer a convenience helper, this package also provides CreateSharedReportStream and CreateSharedObserveStream which wrap these patterns. They are opt-in and live in Prognosis.Reactive.
Dependencies
- Prognosis (core library)
- System.Reactive >= 6.0.1
Requirements
- .NET Standard 2.0+ (.NET Framework 4.6.1+, .NET Core 2.0+, .NET 5+)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Prognosis (>= 2.1.0)
- System.Reactive (>= 6.0.1)
-
.NETStandard 2.1
- Prognosis (>= 2.1.0)
- System.Reactive (>= 6.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.