RxJS / Rx.Net Observable-subscribe vs async-wait

I recently started working on Reactive Extensions, mostly client-side observables, using Angular 2. The concept of observable Rx and dotnet asynchronous wait seems very similar. Are there any concrete examples where they are applicable, while others are not. If not, is there another reason Microsoft introduced Rx.Net because observable elements are at the core of Reactive Extensions. Any real-time links or examples would be sufficient. I am looking for a difference in threads / performance.

+4
source share
1 answer

These are different abstractions. Everything in this answer equally applies to JavaScript and C #.

async/ awaitallow you to wait asynchronously for a single asynchronous operation. This "asynchronous operation" can complete only once, with a single result.

Observables allow you to subscribe to a data stream and respond to data entering this stream. This subscription model allows you to use multiple data items over time.

+10
source

Source: https://habr.com/ru/post/1681501/


All Articles