Nouvelle version de Reactive Extensions

Nouvelle version de Reactive Extensions

La nouvelle version 1.0.10425 de la librairie Reactive Extensions vient de sortir et contient quelques modifications notoires.

Si vous souhaitez mettre à votre votre librairie ou tout simplement si vous êtes débutant et que vous ne comprenez pas pourquoi les exemples d’internet ne compile pas ou plante, voici quelques clés.

La fonction Observable.FromEvent(object,string) qui est largement utilisé pour associer un évènement comme Click ou MouseMove a été renommé, il faut maintenant utiliser Observable.FromEventPattern.

De même, si vous aviez l’habitude d’écrire :

 Observable.FromEvent<eventHandler, EventArgs>
                (h => h.Invoke,
                 h => myEvent += h,
                 h => myEvent -= h);

Sachez que le prototype du premier paramètre a évolué, il faudra écrire maintenant

 Observable.FromEvent<eventHandler, EventArgs>
                (h => (o,r)=> {ev(r);},
                 h => myEvent += h,
                 h => myEvent -= h);

Enfin, il semblerait que méthode

 Observable.FromEvent<eventHandler, EventArgs>
                (h => myEvent += h,
                 h => myEvent -= h);


ne semble plus fonctionner et lance une ArgumentException.

Voici le reste des changements :

Changelog

  • Fixed time delay in Window and Buffer operators
  • Fixed bug in GroupJoin
  • Fixed bug in Merge(n)
  • Renamed Window* to Window
  • Renamed Buffer* to Buffer
  • Renamed Generate* to Generate
  • Removed RemoveTimeInterval
  • Removed RemoveTimestamp
  • Removed Scan0
  • Removed Let on TValue
  • Ensured parity between Buffer and Window overloads, every overloads exists for both
  • Added absolute time scheduling to IScheduler
  • Renamed Join (as in the pattern) to When
  • Added overload to Sample that takes an IObservable
  • Moved TestScheduler to Microsoft.Reactive.Testing
  • Created ReactiveTest base type with useful members
  • Added state parameter to IScheduler schedule methods
  • Added additional overloads for First/Last/Single (OrDefault)
  • Added ElementAt
  • Added Distinct
  • Renamed FromEvent to FromEventPattern
  • Added FromEvent which converts from non-standard events to observables
  • Added ToEventPattern and IEventPatternSource
  • Added ToEvent and IEventSource
  • Improved performance of Task.ToObservable
  • Removed IEvent, Added EventPattern
  • Added ReactiveAssert class with common asserts in Microsoft.Reactive.Testing
  • Split release into Experimental and Stable
  • – Stable is only available on .NET 4, SL 4, and WP7
  • – Marked all parts of the API which are only available in Experimental with the ExperimentalAttribute
  • Improved Doc comments
  • Fixed a bug in Concat, OnErrorResumeNext, and Catch
  • Improved perf of subjects
  • Removed VirtualScheduler
  • Added VirtualTimeSchedulerBase, VirtualTimeScheduler
  • Added HistoricalSchedulerBase, HistoricalScheduler
  • Remove extended Action and Func Definitions in System.Reactive for downlevel platforms
  • Stopped shipping TPL 3.5
  • Temporarily not shipping System.Linq.Async, Ix, and RxJS
  • Added documentation for Microsoft.Reactive.Testing
  • Changed IScheduler interface, there are new extension methods on Scheduler which expose the old methods, but implementors will need to change; recursive and distributed scheduling
  • New Assembly structure:
  • – System.Reactive (what used to be CoreEx and Reactive)
  • – System.Reactive.Providers (Qbservable, IQbservable, and IQbservableProvider) – Observable.Provider is now Qbservable.Provider
  • – System.Reactive.Windows.Forms (all operators, schedulers, etc related to Windows Forms)
  • – System.Reactive.Windows.Threading (all operators, schedulers, etc related to WPF)
  • – Microsoft.Reactive.Testing (all code to assist in writing tests)
  • Third-party Qbservable extensibility
  • New namespace structure:
  • – System
  • – Reactive
  • – Linq
  • – Disposables
  • – Concurrency
  • – Joins
  • – Subjects
  • – Threading
  • – Tasks
  • – Windows
  • – Threading
  • – Forms
  • – Microsoft
  • – Reactive
  • – Testing
  • MutableDisposable changed to take an assignment policy
  • Reduced the memory consumption of CurrentThreadScheduler, VirtualTimeScheduler, HistoricalScheduler, and EventLoopScheduler
  • Reduced the memory consumption of many operators
  • Added Unit.Default
  • Added static class Subject with a few operators for Subjects
  • Removed CurrentThreadScheduler.EnsureTrampoline, Added CurrentThreadScheduler.ScheduleRequired
  • Added Observer.Synchronize
  • Made IObservable compatible with new Async CTP in the Experimental subset
  • Using await on IObservable now only returns the last message, if you want the old behavior use ToList first
  • Replaced all Subject* with FastSubject*, if you want old behavior then create a subject and use the Subject.Synchronize operator
  • Removed publish overloads that take a scheduler

 

Comments are closed.