How to use Observable.FromEvent instead of FromEventPattern and avoid string literal event names

Summary The first point to make is that you don’t actually need to use Observable.FromEvent to avoid the string literal reference. This version of FromEventPattern will work: var groupedKeyPresses = Observable.FromEventPattern<KeyPressEventHandler, KeyPressEventArgs>( h => KeyPress += h, h => KeyPress -= h) .Select(k => k.EventArgs.KeyChar) .GroupBy(k => k); If you do want to make FromEvent … Read more

SignalR vs. Reactive Extensions

No, they are absolutely not the same thing. Reactive Extensions is a library for creating and composing observable streams of data or events (which are actually quite similar). It basically knows nothing about client-server connections or other things. It is focused solely on Observables and is capable of wrapping any collection, stream, event, async method, … Read more

What is the conceptual difference between SynchronizationContext and TaskScheduler

I was just reading CLR via C# book by Jeffrey Ritcher and thanks to him I can also give some easy explanation related to that topic. (assuming that I am not fully agreed with the whole details in answers) First of all, TaskScheduler object is responsible for executing scheduled tasks. The FCL ships with two … Read more

What are the default Schedulers for each observable operator?

Wow, that was not trivial to find… Deep within the bowels of the System.Reactive.Concurrency namespace, there is an internal static class called SchedulerDefaults, which is declared as: internal static class SchedulerDefaults { internal static IScheduler AsyncConversions { get { return DefaultScheduler.Instance; }} internal static IScheduler ConstantTimeOperations { get { return ImmediateScheduler.Instance; }} internal static IScheduler … Read more

IObservable vs Plain Events or Why Should I use IObservable?

Observable is the cornerstone of the Rx library. They provide pretty much all the implementations and operators you’ll need. The idea behind IObservable<T> and Rx is not just the “handling” of events, but enabling “LINQ to Events.” So you can easily compose “event streams,” which gives you a lot of power compared to regular event … Read more

ObserveOn and SubscribeOn – where the work is being done

There’s a lot of misleading info out there about SubscribeOn and ObserveOn. Summary SubscribeOn intercepts calls to the single method of IObservable<T>, which is Subscribe, and calls to Dispose on the IDisposable handle returned by Subscribe. ObserveOn intercepts calls to the methods of IObserver<T>, which are OnNext, OnCompleted & OnError. Both methods cause the respective … Read more

How do Reactive Framework, PLINQ, TPL and Parallel Extensions relate to each other?

PLINQ (Parallel Linq) is simply a new way to write regular Linq queries so that they run in parallel – in other words, the Framework will automatically take care of running your query across multiple threads so that they finish faster (i.e. using multiple CPU cores). For example, let’s say that you have a bunch … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)