using System.Reactive.Linq;
using System.Threading.Tasks;
public static async Task Main()
.Interval(TimeSpan.FromMilliseconds(100))
.SelectMany(x => Observable.FromAsync(async ct =>
if (x == 3) throw new ApplicationException("Oops!");
Console.WriteLine($"Operation #{x} completed");
.Do(x => Console.WriteLine($"Result: {x}"));
Console.WriteLine($"Failed, {ex.GetType().Name}: {ex.Message}");