1

I am using Rx Buffer to club the operation for 2 seconds. But I want to reset the timespan counter if new request comes before time span expires.

_Event.Buffer(TimeSpan.FromMilliseconds(2000))
    .Where(obj => obj.Count > 0)
    .Subscribe(this._Observer);

i.e

The first request came at 12:00PM and new request came at 12:01, then I want to reset the timespan for another next 2 seconds and so on. If there is no request for continuous 2 seconds, then execute the OnNext of observer.

Theodor Zoulias
  • 34,835
  • 7
  • 69
  • 104
Yogesh
  • 3,044
  • 8
  • 33
  • 60
  • Is this question relevant? [Does reactive extensions support rolling buffers?](https://stackoverflow.com/questions/7597773/does-reactive-extensions-support-rolling-buffers) – Theodor Zoulias Oct 31 '21 at 13:38
  • 1
    Thanks, Yes Indeed I was looking for the same. Marked it duplicates. – Yogesh Oct 31 '21 at 14:38

0 Answers0