Questions tagged [rx.net]

The Reactive Extensions (Rx) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators.

The Reactive Extensions (Rx) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators. Using Rx, developers represent asynchronous data streams with Observables, query asynchronous data streams using LINQ operators, and parameterize the concurrency in the asynchronous data streams using Schedulers. Simply put, Rx = Observables + LINQ + Schedulers.

See:

209 questions
31
votes
2 answers

C# method overload resolution issues in Visual Studio 2013

Having these three methods available in Rx.NET library public static IObservable Create(Func, CancellationToken, Task> subscribeAsync) {...} public static IObservable
Mooh
  • 684
  • 4
  • 21
27
votes
3 answers

How to call back async function from Rx Subscribe?

I would like to call back an async function within an Rx subscription. E.g. like that: public class Consumer { private readonly Service _service = new Service(); public ReplaySubject Results = new ReplaySubject(); …
21
votes
3 answers

How can I clear the buffer on a ReplaySubject?

How can I clear the buffer on a ReplaySubject? Periodically I need to clear the buffer (as an end of day event in my case) to prevent the ReplaySubject continually growing and eventually eating all the memory. Ideally I want to keep the same…
CodingHero
  • 2,505
  • 5
  • 23
  • 41
14
votes
1 answer

RxJS/Rx.Net Observable-subscribe vs events - Performance/Threads

I recently started working on Reactive Extensions, mostly observables at client side using Angular 2. The concept of observables of Rx and events of dotnet seems to be very similar. Are there any specific examples where one is applicable and other…
Sreenath
  • 338
  • 2
  • 8
13
votes
4 answers

Trouble Implementing a Sliding Window in Rx

I created a SlidingWindow operator for reactive extensions because I want to easily monitor things like rolling averages, etc. As a simple example, I want to subscribe to hear mouse events, but each time there's an event I want to receive the last…
blaster
  • 8,566
  • 10
  • 43
  • 73
10
votes
2 answers

Why is IEnumerable.ToObservable so slow?

I am trying to enumerate a large IEnumerable once, and observe the enumeration with various operators attached (Count, Sum, Average etc). The obvious way is to transform it to an IObservable with the method ToObservable, and then subscribe an…
Theodor Zoulias
  • 15,834
  • 3
  • 19
  • 54
8
votes
2 answers

Rx.Net Message Parser

I'm trying to parse an incoming stream of bytes that represents messages. I need to split the stream and create a message structure for each part. A message always starts with a 0x81 (BOM) and ends with a 0x82 (EOM). start: 0x81 header: 3…
Omer Mor
  • 5,138
  • 2
  • 31
  • 39
8
votes
4 answers

What's a good way to run periodic tasks using Rx, with a single concurrent execution restriction?

I want to run periodic tasks in with a restriction that at most only one execution of a method is running at any given time. I was experimenting with Rx, but I am not sure how to impose at most once concurrency restriction. var timer =…
smartnut007
  • 5,913
  • 5
  • 40
  • 50
7
votes
4 answers

Using AsObservable to observe TPL Dataflow blocks without consuming messages

I have a chain of TPL Dataflow blocks and would like to observe progress somewhere inside the system. I am aware that I could just jam a TransformBlock into the mesh where I want to observe, get it to post to a progress updater of some variety and…
theStrawMan
  • 195
  • 9
7
votes
3 answers

Equivalent of RxJS switchMap in ReactiveX/Rx.NET

In RxJS, there is a switchMap function. Is there an equivalent in ReactiveX/Rx.NET? I don't see one in the transforming documentation.
wonderful world
  • 8,704
  • 14
  • 76
  • 142
7
votes
3 answers

With Reactive Extensions (RX), is it possible to add a "Pause" command?

I have a class which takes in a stream of events, and pushes out another stream of events. All of the events use Reactive Extensions (RX). The incoming stream of events is pushed from an external source into an IObserver using .OnNext, and the…
Contango
  • 65,385
  • 53
  • 229
  • 279
6
votes
3 answers

Create observable from periodic async request

I want a generic way to convert an asynchronous method to an observable. In my case, I'm dealing with methods that uses HttpClient to fetch data from an API. Let's say we have the method Task GetSomeData() that needs to become a single…
figursagsmats
  • 124
  • 1
  • 14
6
votes
1 answer

Is there an example of Ix.NET (System.Interactive) somewhere?

I have an async method, say: public async Task GetAsync() { } and would be called from: public async Task> GetAllAsync() { foreach (var item in something) { var result = await GetAsync(); yield return…
nawfal
  • 62,042
  • 48
  • 302
  • 339
6
votes
4 answers

How to use Rx.Nex extension ForEachAsync with async action

I have code which streams data down from SQL and writes it to a different store. The code is approximately this: using (var cmd = new SqlCommand("select * from MyTable", connection)) { using (var reader = await cmd.ExecuteReaderAsync()) { …
Mark Shamis
  • 243
  • 2
  • 6
6
votes
5 answers

Unwrapping IObservable> into IObservable with order preservation

Is there a way to unwrap the IObservable> into IObservable keeping the same order of events, like this? Tasks: ----a-------b--c----------d------e---f----> Values: -------A-----------B--C------D-----E---F--> Let's say I have a desktop…
yallie
  • 1,208
  • 18
  • 24
1
2 3
13 14