I have the below types ...
public class NewsFeed
{
public event EventHandler NewItem;
.....
}
public class NewsItemEventA
I couldn't get the answer from Asti to work. So I tried the undocumented Delay overload with the delayDurationSelector. I got it working for my problem, though somehow it's not behaving correctly when I use the scheduler in the timer, but it works without it:
public static IObservable DelayBetweenValues(this IObservable observable, TimeSpan interval,
IScheduler scheduler)
{
var offset = TimeSpan.Zero;
return observable
.TimeInterval(scheduler)
.Delay(ti =>
{
offset = (ti.Interval < interval) ? offset.Add(interval) : TimeSpan.Zero;
return Observable.Timer(offset);
})
.Select(ti => ti.Value);
}