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
4
votes
2 answers

Correct way of long running API calls in RX.net and WPF

I've been happily making some API calls in a WPF app using RX in the following manner: IDisposable disposable = _textFromEventPatternStream .ObserveOn(_rxConcurrencyService.Dispatcher) .Subscribe(async input => { …
4
votes
2 answers

React Native, Rx.Net and RxSwift: commonalities

I am using RxSwift as part of a project that someone else started. Wanting to understand a bit more on the theory of ReactiveX I bumped into React Native and Rx.Net. I would like to make sure I understand the following correctly: React Native is a…
mm24
  • 9,280
  • 12
  • 75
  • 170
4
votes
2 answers

Entity Framework Core async/wait deadlock when using "one-to-many" relationship and WebApi

I'm encountering a deadlock when using asynchronous implementation of an EF Core provider. Say I have the following models: public class Player { public string PlayerId { get; set;} public string Name { get; set;} public List
Tomer Peled
  • 3,571
  • 5
  • 35
  • 57
4
votes
2 answers

How do I poll with state using Reactive Extensions?

There is already a good question on database polling using Reactive (Database polling with Reactive Extensions) I have a similar question, but with a twist: I need to feed a value from the previous result into the next request. Basically, I would…
Mark Sowul
  • 10,244
  • 1
  • 45
  • 51
4
votes
1 answer

How do I get the last known value of an IObservable?

Suppose I am building an image editor using Rx.Net. The user can manipulate the canvas using the mouse. The manipulation that is applied depends on the currently selected tool. For example, there might be a "draw" tool and an "erase" tool. Only one…
sdgfsdh
  • 33,689
  • 26
  • 132
  • 245
4
votes
2 answers

Rx: a zip-like operator that continues after one of the streams ended?

I'm looking to combine streams (observables) that start and end asynchronously: -1----1----1----1---|-> -2----2--|-> [ optional_zip(sum) ] -1----3----3----1---|-> What I need it for: Adding audio streams together. They're streams of audio…
uryga
  • 402
  • 4
  • 14
4
votes
1 answer

How to convert blocking events to Observable?

I am learning .net Rx (Reactive Extensions) library and trying to create a proper Observable that read user input from Console. So far I came to this: public static IObservable ConsoleInputObservable() { return…
Dmitrii
  • 321
  • 6
  • 17
4
votes
2 answers

In RX is there a way to bind a source stream to a dest stream so the source can be changed without affecting the client's subscription?

I'm using RX and I want to bind/map a source stream to a destination stream so that the source stream can be dynamically changed without affecting any subscription to the destination stream. I'll layout my (naive) solution here in the hope that…
Ashley Davis
  • 9,896
  • 7
  • 69
  • 87
3
votes
1 answer

Make System.Reactive repeat last X items on new subscribe

How can I achieve next logic with System.Reactive? IObservable that produce new items (ints) on timer when at least one subscriber exist and when new subscriber subscribes, it repeats last X items for new subscriber. Example: Let X =…
nuclear sweet
  • 1,079
  • 10
  • 27
3
votes
0 answers

Does the Rx library omits disposing of the CancellationTokenSources it creates?

The Rx library includes operators that accept lambda parameters, and some of these lambdas are provided with a CancellationToken that is controlled by the library itself. Some examples of these operators are the FromAsync, StartAsync and Create: //…
3
votes
1 answer

How to merge two observables with early completion

The behavior of the built-in Merge operator is to complete when both sources are completed. I am searching for a variant of this operator that produces an observable that completes when any of the two source observables completes. For example if the…
Theodor Zoulias
  • 34,835
  • 7
  • 69
  • 104
3
votes
1 answer

Transform IObservable into another sequence that faults or completes based on elements of the input sequence

I'm implementing an inter-process messaging system, where e.g. the client can request certain data from the server. The server needs to be able to send back its reply in the form of partial repsonses, and also needs to be able to nofity the client…
Bogey
  • 4,926
  • 4
  • 32
  • 57
3
votes
1 answer

Bridging Events in Xamarin with Rx

At the moment, I'm just using the plain old delegates/events observer pattern for click events on my buttons. So, I thought I would go Rx. My first attempt was balls. I thought I'd go for the simplest overload that you see in WinForms…
onefootswill
  • 3,707
  • 6
  • 47
  • 101
3
votes
1 answer

pairwise operator using .buffer in rx.net

I need to automatically back up my files from external drivers (such as usb keys) When the driver is plugged in. to know when a new usb or hard drive is inserted I used an observable, the problem is that the only way I know about getting connected…
3
votes
1 answer

How to compose an observable with a task that might need to be re-run?

Suppose I have an async method that runs a query and returns a set of results: Task> FetchResultSet(); And I have an observable that fires whenever the result set needs to be fetched again: IObservable NeedToRefetch; What I…
Eric Sink
  • 342
  • 1
  • 7
1 2
3
17 18