title: What is the best way to "rate limit" consuming of an Observable?
body: <p>I have a bunch of events coming in and I have to execute ALL of them without a loss, but I want to make sure that they are buffered and consumed at the appropriate time slots. Anyone have a solution?</p>
  
  <p>I can't find any operators in Rx that can do that without the loss of the events (Throttle - looses events). I've also considered Buffered, Delay, etc... Can't find a good solution.</p>
  
  <p>I've tried to put a timer in the middle, but somehow it doesn't work at all: </p>
  
  <pre><code>GetInitSequence()
              .IntervalThrottle(TimeSpan.FromSeconds(5))
              .Subscribe(
                  item =&gt;
                      {
                          Console.WriteLine(DateTime.Now);
                          // Process item
                      }
              );
  
  public static IObservable&lt;T&gt; IntervalThrottle&lt;T&gt;(this IObservable&lt;T&gt; source, TimeSpan dueTime)
      {
          return Observable.Create&lt;T&gt;(o =&gt;
              {
                  return source.Subscribe(x =&gt;
                      {
                          new Timer(state =&gt; 
                              o.OnNext((T)state), x, dueTime, TimeSpan.FromMilliseconds(-1));
                      }, o.OnError, o.OnCompleted);
          });
      }
  </code></pre>