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

Strange Rx+CancellationToken issue: sometimes the registered callback does not complete

I observed a strange phenomenon that occurs sometimes with an Rx query I wrote, that involves a CancellationToken. Two callbacks are registered to the same CancellationToken, one outside of the query and one that is part of the query. The intention…
Theodor Zoulias
  • 34,835
  • 7
  • 69
  • 104
2
votes
1 answer

How to make the Rx callbacks run on the ThreadPool?

Would you expect that the program below prints False? using System; using System.Threading; using System.Reactive.Linq; using System.Reactive.Concurrency; public static class Program { public static void Main() { Observable …
Theodor Zoulias
  • 34,835
  • 7
  • 69
  • 104
2
votes
1 answer

how to create observable from blazor element's click events

@* test.razor *@ I have a button in a razor component, and I want to create an Observable from it's click event which I don't know how to do. Can anyone help me ?
马邦德
  • 103
  • 1
  • 9
2
votes
2 answers

How to fix the inconsistency of the Publish().RefCount() behavior?

Recently I stumbled upon an interesting statement by Enigmativity about the Publish and RefCount operators: You're using the dangerous .Publish().RefCount() operator pair which creates a sequence that can't be subscribed to after it…
Theodor Zoulias
  • 34,835
  • 7
  • 69
  • 104
2
votes
2 answers

How to merge multiple observables with order preservation and maximum concurrency?

I searched for a duplicate and didn't find any. What I have is a nested observable IObservable>, and I want to flatten it to a IObservable. I don't want to use the Concat operator because it delays the subscription to each inner…
Theodor Zoulias
  • 34,835
  • 7
  • 69
  • 104
2
votes
3 answers

Observable of IDisposable object: How to dispose previous value onNext and onComplete?

I have an Observable of IDisposable value IObservable disposableValues = source.Select(val => MyDisposableObject()); How to write a pipe that dispose old value, when: new value is emitted when the source completes? I think #1 can be…
Liero
  • 25,216
  • 29
  • 151
  • 297
2
votes
3 answers

subject.Dispose() vs subject.OnCompleted()

What's the difference between .Dispose() and .OnCompleted() call on a Subject ? Usually i dispose subscription to stop listening an observable and complete a subject when it's no longer useful anywhere on the code,
2
votes
1 answer

How to implement a ScanAsync operator with async accumulator in Rx.Net?

The Scan Operator in Rx.Net has signature: public static IObservable Scan(this IObservable source, TAccumulate seed, Func accumulator); The accumulator…
xiang0x48
  • 621
  • 6
  • 20
2
votes
1 answer

Rx.Net GroupBy, How to subscribe multiple observers to a specific Group

I am taking my first leap into the world of Rx and finding it difficult to get the desired results, especially with the GroupBy operator, so any help would be much appreciated. How can I subscribe multiple observers to a specific group? My…
Triplegang
  • 23
  • 1
  • 4
2
votes
1 answer

Is it possible to add a custom message to the Rx.Net Timeout operator

I am trying to read a stream of data from device and find the valid data in it. It is a set of zeroes with some data in between. Something like: 0,0,0,1,2,3,2,1,0,0,0,0,1,2,3,2,1,0,0,0 and so on. What is emitted after processing is the sum of the…
NotAgain
  • 1,927
  • 3
  • 26
  • 42
2
votes
1 answer

Reactive Extensions OperationCancelled exception on Enumerable.Range / Observable.FromAsync

I have the below code which is pulling data from a REST paginated API. When using reactive extensions, it gets near to the end of the downloads (i.e. page 1,636 out of the known target 1,653, the exact count it gets to depends on concurrent fetches…
morleyc
  • 2,169
  • 10
  • 48
  • 108
2
votes
2 answers

How to change IObservable Func predicates at runtime in C#

I'm new to dynamic data and in general the reactive extension world and I'm currently facing a following problem, where I'd like to change the IObservable> predicates at runtime by using the dynamic data package and thus the reactive…
PythonNoob
  • 914
  • 1
  • 7
  • 15
2
votes
1 answer

How to combine "IObservable IsActive" and "bool IsEnabled" in one subsciption

Having two properties, one of type public IObservable IsEnabled { get; set; } and the second public bool IsActive { get;set; } and I want to combine the two properties in one using System.Reactive like that public bool IsActiveAndEnabled…
Mselmi Ali
  • 1,139
  • 2
  • 18
  • 28
2
votes
2 answers

How do I prevent by Rx test from hanging?

I am reproducing my Rx issue with a simplified test case below. The test below hangs. I am sure it is a small, but fundamental, thing that I am missing, but can't put my finger on it. public class Service { private ISubject
resp78
  • 1,414
  • 16
  • 37
2
votes
3 answers

Properly using multiple resources with Rx

I need to use multiple disposable resources with Rx. This is how I have nested the Observable.Using statements (the inner source is just for testing). var obs = Observable.Using( () => new FileStream("file.txt", FileMode.Open), fs =>…
ZorgoZ
  • 2,974
  • 1
  • 12
  • 34