Is SignalR the same thing is Reactive Extensions? Can you explain why or why not?
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 Observable
s and is capable of wrapping any collection, stream, event, async method, etc. into the common Observable
interface.
SignalR is a toolkit for creating persistent (i.e. alive) duplex connections between client and server. It works over HTTP and its purpose is wrapping 3 low-level techniques: long-polling, server-side events and web sockets into a high-level API for comfortable development. So, it's focused on the communication.
So, the components themselves are quite independent from each other, and they have completely different concerns.
On the other hand, these 2 great libraries are complementary to each other: one might use SignalR to push events from server to clients and then wrap the server-side events into RX's Observable
s to create complex reactive user experiences.
UPDATE
Rx is like LINQ, it helps you specify 'what happens', it doesn't get into the details of 'how'. SignalR is a library to implement the 'how' for real-time network communication – Paul Betts
The difference between 'LINQ to Objects' and RX is that in 'LINQ to Objects' you pull next items from an enumerable thing, while in RX they are pushed to you from an observable thing.
IEnumerable<T>
interface. LINQ is the combined language features of Anon Types, Extension methods, Lambdas, Expression (trees) and Query Comprehension Syntax. –
Yurikoyursa System.Linq.Enumerable
class, that is LINQ to Objects. I'll update the answer to use LINQ to Objects to avoid confusion. –
Sociable © 2022 - 2024 — McMap. All rights reserved.