Skip to content

ionutme/workshop-rx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reactive Programming with Rx.NET

We're walking the path set forth by Lee Campbell's Intro to Rx.

Stopovers

  • Key types
    • IObservable<T> and IObserver<T> (and maybe even ISubject<T>)
    • Subject<T>, ReplaySubject<T>, BehaviorSubject<T>, AsyncSubject<T>
  • Lifetime management
    • IDisposable and its variants
    • The IDisposable returned by the Subscribe extension methods will dispose itself upon OnCompleted or OnError. Other implementations won't. Still, you should always capture and dispose of subscriptions yourself when possible.
  • Creating sequences
    • Introducing Timestamp and TimeInterval as handy tools for reasoning about streams
    • Creating sequences and the power of the lazily evaluated Observable.Create
    • Functional unfolds and the other powerful generation method: Observable.Generate
    • Transitioning into observables by switching between domains (from Task or Action/Func)
  • Reducing sequences
    • Filtering with Where
    • Determining Distinct elements, and introducing pairwise distinction with DistinctUntilChanged
    • Skip and Take
  • Inspecting sequences
    • Any vs. All vs. Contains
    • Gracefully handling the empty sequence scenario
    • ElementAt and why not to use it
    • Comparing two sequences for equality with SequenceEqual
  • Aggregating sequences
    • Sequence math: Min, Max, Sum, Average
    • Functional folds: First/Last/Single[OrDefault][Async]
    • Custom aggregations and the relationship between Aggregate and Scan
    • Partitioning sequences
  • Transforming sequences
    • Mapping with Select and its contactual obligations
    • Casting and materializing
    • SelectMany, the powerful bind function
    • Visualizing sequences
  • Side effects
    • Never leak effects out of pipelines, but if you must, use Do to emphasize them
  • Advanced error handling
    • Catch vs. OnErrorResumeNext, maybe Retry
    • Using binds the lifetime of a resource to that of a sequence
    • Finally no matter what
  • Combining sequences
    • Combining sequentially requires completion: Concat, Repeat, StartWith
    • Combining concurrently doesn't: Amb, Merge, Switch
    • Pairing is either in sync with the rate of generation: Zip & And/Then/When, or it isn't: CombineLatest
  • Time-shifted sequences
    • Buffering: size vs. time triggers
    • Overlapping, rolling or skipped buffering
    • Simple time shifting with Delay
    • Sample vs. Throttle
    • Timeout and the beauty of operator composure
  • Temperature
    • Use Publish and Connect for taming hotness
    • Use Publish and RefCount for the added benefit of the last guy turns off the light
    • Discover Multicast and its power
  • Scheduling
    • Rx is single threaded and synchronous by default
    • SubscribeOn is for scheduling the subscription code (like for Observable.Create)
    • ObserveOn is for moving the processing to another thread
    • ImmediateScheduler vs. CurrentThreadScheduler, EventLoopScheduler vs. NewThreadScheduler
    • ThreadPoolSchedulervs. TaskPoolScheduler, DispatcherScheduler

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%