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.

Resources:

264 questions
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
  • 76,540
  • 58
  • 260
  • 305
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
  • 155
  • 1
  • 1
  • 15
6
votes
1 answer

How can I implement an exhaustMap handler in Rx.Net?

I am looking for something similar to the exhaustMap operator from rxjs, but RX.NET does not seem to have such an operator. What I need to achieve is that, upon every element of the source stream, I need to start an async handler, and until it…
wh1t3cat1k
  • 3,146
  • 6
  • 32
  • 38
6
votes
1 answer

RX.Net : Use Retry but log any Exception

I am new to RX and have been investigating error handling and the use of Retry; I have the following (yes I know it's not a 'real' unit test but it gives me place to fiddle!!) and was wondering how I go about keeping the Retry but be able to log any…
inthegarden
  • 267
  • 1
  • 11
5
votes
1 answer

Why are these Rx sequences out of order?

Suppose I write var gen = Observable.Range(1, 3) .SelectMany(x => Observable.Range(1, x)); The sequence produced is 1 1 2 1 2 3 as expected. But now if I write var gen = Observable.Range(1, 4) .SelectMany(x => Observable.Range(1, x)); Now the…
Dmitri Nesteruk
  • 23,067
  • 22
  • 97
  • 166
5
votes
3 answers

Take the last item pushed to an Observable (Sequence)

I have an IObservable inside a class and I want to expose a read-only property that provides the last item pushed to the observable at a given time. So it will provide a single value of Item. If no value has been pushed, then it will have to…
SuperJMN
  • 13,110
  • 16
  • 86
  • 185
5
votes
2 answers

How do I turn a polling system into an Rx.Net IObservable?

I have a game (based on MonoGame / XNA) with an update method like so: public void Update(GameTime gameTime) { component.Update(gameTime); } I would like to convert this to the Reactive pattern. My current solution is: public void…
sdgfsdh
  • 33,689
  • 26
  • 132
  • 245
5
votes
1 answer

Rx: Count of Grouped Events in Moving Window

I have started looking at using Reactive Extensions with EventStore. As a proof of concept, I'd like to see if I can get Rx to consume an event stream and output the count of events grouped by type for a window of one second. So, say that I am…
David Brower
  • 2,888
  • 2
  • 25
  • 31
4
votes
1 answer

How to make a lightweight `Replay` operator that can be subscribed only once?

In various occasions I've wished for an Rx Replay operator that buffers the incoming notifications, replays its buffer synchronously when it is subscribed for the first time, and stops buffering after that. This lightweight Replay operator should be…
Theodor Zoulias
  • 34,835
  • 7
  • 69
  • 104
4
votes
1 answer

Rx .NET: ToTask vs LastAsync vs RunAsync

Reactive Extensions has these three methods: ToTask: Returns a task that will receive the last value or the exception produced by the observable sequence. LastAsync: Returns the last element of an observable sequence RunAsync: Gets an awaiter that…
Daniel Lo Nigro
  • 3,346
  • 27
  • 29
4
votes
1 answer

Multi-Producer Multi-Consumer data synchronization with separated queues

I have the following scenario: a variable number ( greater than three ) of queues (depends on a configuration set in a file) some of these queues can either be fed with data or not (it depends on the producer that receives data through a network…
4
votes
2 answers

How to extend the duration time of Observable Timer in Rx.NET?

Using C# with Rx.NET. Is there a way to extend the duration time of an Observable.Timer after it was started? Is there a way with Join(...) or Expand(...)? I do not like to dispose the old timer and not like to create a new one. Example: initial…
this.myself
  • 2,101
  • 2
  • 22
  • 36
4
votes
2 answers

Buffer by time or running sum for reactive extensions

I'm quite new to Reactive Extensions and want to buffer a stream based on time, or by a running sum not exceeding a threshold (size of each item is specified by a lambda) whichever occurs first, much like the existing Buffer by count or…
Per
  • 559
  • 5
  • 11
4
votes
1 answer

Disruptor vs. Reactive architecture for middle-frequency trading system

I'm trying to choose an appropriate architecture for a middle-frequency trading system I'm working on. Currently, I receive messages from Web Socket or Rest and process them right there. Sometimes it includes IO operations (i. e. additional rest…
SiberianGuy
  • 24,674
  • 56
  • 152
  • 266
4
votes
1 answer

BehaviorSubject as backing field?

In Intro to Rx the following is said: BehaviorSubjects are often associated with class properties. As they always have a value and can provide change notifications, they could be candidates for backing fields to properties. However I couldn't…
The Oddler
  • 6,314
  • 7
  • 51
  • 94
1
2
3
17 18