I started using the ExhaustMap, all well and very valueable extension, until I tried to Retry
.
Take the next snippet which is a modified version of the original post usage sample.
await Observable
.Interval(TimeSpan.FromMilliseconds(200))
.Select(x => (int)x + 1)
.Take(10)
.Do(x => Console.WriteLine($"Input: {x}"))
.ExhaustMap(x => Observable.Throw<Unit>(new InvalidOperationException()))
.Retry(2)
.Do(x => Console.WriteLine($"Result: {x}")).FirstOrDefaultAsync();
Exit code is -532462766 (Unhandled exception. System.ObjectDisposedException: The semaphore has been disposed.
How to appropriately handle this case, semaphore does not have a public IsDisposed property and I am expecting an InValidOperationException
and not an ObjectDisposed