title: Interval continue working after onErrorResumeNext
body: <p>I´m using Interval operator, and I want to continue emitting items even if a Exception happens on my pipeline. </p>
  
  <p>So I try to use <code>onErrorResumeNext</code> emitting an item in case of Exception. But I seen that after emitt this item, the interval stop emitting more items.</p>
  
  <p>Here my unit test.</p>
  
  <pre><code>@Test
  public void testIntervalObservableWithError() {
      Subscription subscription = Observable.interval(50, TimeUnit.MILLISECONDS)
              .map(time -&gt; "item\n")
              .map(item -&gt; item = null)
              .map(String::toString)
              .onErrorResumeNext(t-&gt; Observable.just("item with error emitted"))
              .subscribe(System.out::print, t-&gt;{
                          System.out.println(t);
                      }
                     );
      TestSubscriber testSubscriber = new TestSubscriber((Observer) subscription);
      testSubscriber.awaitTerminalEvent(20000, TimeUnit.MILLISECONDS);
  }
  </code></pre>
  
  <p>I´m confuse with this behaviour, why the observable unsubscribe if it´s receiving an item from <code>onErrorResumeNext</code></p>
  
  <p><strong>SOLUTION:</strong></p>
  
  <p>After some explanations, I realize that when an error happens the observable t´s complete. So I end up wrapping that observable that can have an exception into another observable and I´m using flatMap. So then the main Observable continue emitting items.</p>
  
  <pre><code>@Test
  public void testIntervalObservableWithError() {
      Observable.interval(100, TimeUnit.MILLISECONDS)
              .map(time -&gt; "item\n")
              .flatMap(item -&gt; Observable.just(item)
                      .map(String::toString))
              .subscribe(System.out::print); 
      TestSubscriber testSubscriber = new TestSubscriber();
      testSubscriber.awaitTerminalEvent(5000, TimeUnit.MILLISECONDS);
  }
  </code></pre>
  
  <p>If there´s any operator that can do all that magic I would like to know. </p>
  
  <p>Regrads</p>