Skip to content

SinkSubscription class

Defined in

Namespace: ReactiveUI.Primitives.Advanced Assembly: ReactiveUI.Primitives.Core.dll Full name: ReactiveUI.Primitives.Advanced.SinkSubscription Modifiers: public static

Summary

View source

Shared single-upstream-subscription management for sink observers. Operating on a caller-owned IDisposable field through a ref parameter lets each sink implement IObserver directly — with no shared base class, and therefore no virtual-dispatch overhead on the hot notification path — while still sharing the assign-once / dispose-once teardown.

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481

Methods

NameSummary
static SetAssigns the upstream subscription, disposing it immediately if the sink already holds one or has been disposed.
static DisposeReleases the upstream subscription exactly once, latching a sentinel so later assignments self-dispose.
Inherited members