Changelog
Breaking changes
Sharenow defaults toShareConfig.ResetOnCompletionAndRefCountZero, matching Rx'sPublish().RefCount(): the source is disconnected when the last subscriber leaves, and a completed connection is restarted on the next subscription. Passnew ShareConfig()to keep the previous behavior.Mergeoverloads gained an optionalMergeOptionsparameter. This is source compatible, but code compiled against 1.x must be recompiled.
Performance
AsyncGateuses a pooled FIFO queue of waiters instead ofSemaphoreSlimplus a continuation. Each wait allocates much less, and a release hands the gate straight to the first waiter, so no other caller can jump the queue.- A single
AsyncLocalfor the whole library (ExecutionFlow) replaces the per-observer, per-gate and per-subscription ones, so theExecutionContextstays small in long pipelines. - Linked cancellation tokens are reused across notifications instead of creating a
CancellationTokenSourcefor every value. - Consecutive synchronous
Select/Wherecalls are fused into a single operator. - On net6+,
OnNextAsyncand theMergeforwarding methods usePoolingAsyncValueTaskMethodBuilder. - New
MergeOptions.DetachInnerCancellationoption avoids linking a token per value inMerge.
Fixes
Share: an observer that joins or leaves during a subscription no longer resets the connection. Subscribe and connect failures are handled more reliably.Debounce/Throttle:OnErrorResumeis no longer forwarded after termination.TakeUntil,Debounce,Throttle,Timeout: callers waiting on the gate are released when the subscription is disposed (inTimeout, only forOnErrorResume).TakeUntil: errors are reported toUnhandledExceptionHandlerinstead of being silently swallowed.Merge(IEnumerable): subscribing now waits until all sources are subscribed, and the startup method is no longerasync void.UnhandledExceptionHandler.Registeris thread-safe and rejectsnull.
Infrastructure
global.jsonpins the .NET 10 SDK, and the CI workflows install the SDK version it specifies.