Rx.NET 6.1 now available #2243
                  
                    
                      idg10
                    
                  
                
                  announced in
                Announcements
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
A new minor version of Rx.NET is now available. You can get
System.Reactivev6.1.0 from NuGet today.We've bumped the minor version number because this release has new features.
DisposeWithextension methodThanks to Chris Pulman for implementing this.
This simplifies the use of
CompositeDisposablewhen using a 'fluent' coding style. When subscribing to some observable source, you can append a call to this, e.g.:src.Subscribe(observer).DisposeWith(d);(wheredis aCompositeDisposable).See this video for more details: https://www.youtube.com/watch?v=6wQVb8iyLFU
TakeUntil(CancellationToken)Thanks to Nils Aufschläger for the initial suggestion, and for implementing the operator. Thanks to Daniel Weber for proposing the design we ultimately chose.
As with the existing
TakeUntiloverloads, this provides a way to cause a source to complete early. With this new overload, you can trigger completion with anyCancellationToken. The original motivation for this was to be able to take 'infinite' sources (e.g., anIObservable<T>produced by adapting a .NET event) and provide a way to make them complete.See this video for more details: https://www.youtube.com/watch?v=-ivFY_Hv89Y
ResetExceptionDispatchInfoThanks to Adam Jones for the initial issue report, and for reviewing our work on this.
The .NET runtime's machinery for rethrowing exceptions from some context other than the one in which the exception was first caught assumes that the exception was initially thrown in the conventional way. If it wasn't, and if you reuse the same exception object, its stack trace can grow over time. This is just part of the .NET runtime's behaviour, but it's quite easy to run into this by accident with Rx, because in Rx, exceptions are typically reported not with
throwbut with a call toOnError. So if you use Rx's mechanisms for adapting this to a normal throw (e.g. if youawaitanIObservable<T>) you can run into this issue.We've added a new operator,
ResetExceptionDispatchInfo, that enables you to avoid running into this behaviour if you have set up an Rx observable that might end up causing the same exception to be rethrown multiple times.See this video for more details: https://www.youtube.com/watch?v=_4BVPQit6EM
Intro to Rx updated
We've also published an updated edition of the Intro to Rx book to cover these changes, which you can find at https://introtorx.com/
Beta Was this translation helpful? Give feedback.
All reactions