Bug
Which library version?
System.Reactive.Async 6.0.0-alpha.3
System.Reactive.Linq 5.0.0"
What are the platform(s), environment(s) and related component version(s)?
N/A
What is the use case or problem?
Cancelling ForEachAsync should stop the enumeration.
What is the expected outcome?
Enumeration stopped after token cancelled
What is the actual outcome?
Enumeration continues forever
Do you have a code snippet or project that reproduces the problem?
using System.Reactive.Linq;
var observable = AsyncObservable.Interval(TimeSpan.FromSeconds(1));
var cancellationTokenSource = new CancellationTokenSource();
cancellationTokenSource.CancelAfter(TimeSpan.FromSeconds(5));
await observable.ForEachAsync(seconds =>
{
Console.WriteLine($"Seconds: {seconds}, Is Cancelled: {cancellationTokenSource.Token.IsCancellationRequested}");
}, cancellationTokenSource.Token);
I might be just completely misunderstanding but the behaviour seems odd.
Bug
Which library version?
System.Reactive.Async 6.0.0-alpha.3
System.Reactive.Linq 5.0.0"
What are the platform(s), environment(s) and related component version(s)?
N/A
What is the use case or problem?
Cancelling ForEachAsync should stop the enumeration.
What is the expected outcome?
Enumeration stopped after token cancelled
What is the actual outcome?
Enumeration continues forever
Do you have a code snippet or project that reproduces the problem?
I might be just completely misunderstanding but the behaviour seems odd.