title: How to simulate emitting 2 infiite Observable streams and have other Observable which merges them and buffer every 10 seconds?
body: <p>I want to be able to simulate merging two separate streams which emits some objects(that are extending the same Parent object), buffer them using buffer operator and emit the gathered data after 10 seconds. I want this mechanism to be infinite, in a way that this merge/buffer will always be invoked whenever there is an emission from the 2 separated streams.</p>
  
  <p>Here is what I've done so far:</p>
  
  <pre><code> val list1 = mutableListOf&lt;SomeClass1&gt;(
              SomeClass1("1", 1), SomeClass1("2", 2), SomeClass1("3", 3),
              SomeClass1("4", 4), SomeClass1("5", 5), SomeClass1("6", 6),
              SomeClass1("7", 7), SomeClass1("8", 8), SomeClass1("9", 9)
      )
      val list2 = mutableListOf&lt;SomeClass2&gt;(
              SomeClass2(1.00), SomeClass2(2.00), SomeClass2(3.00),
              SomeClass2(4.00), SomeClass2(5.00), SomeClass2(6.00),
              SomeClass2(7.00), SomeClass2(8.00), SomeClass2(9.00)
      )
  
      val someClass1Observable = Observable
              .fromIterable(list1)
              .zipWith(Observable.interval(2, TimeUnit.SECONDS),
                      BiFunction { item: SomeClass1, _: Long -&gt; item })
  
  
      val someClass2Observable = Observable
              .fromIterable(list2)
              .zipWith(Observable.interval(2, TimeUnit.SECONDS),
                      BiFunction { item: SomeClass2, _: Long -&gt; item })
  
  
      someClass1Observable.subscribe {
          Log.v("someClass1", it.toString())
      }
  
      someClass2Observable.subscribe {
          Log.v("someClass2", it.toString())
      }
  
  
      Observable.merge(someClass1Observable, someClass2Observable)
              .buffer(10, TimeUnit.SECONDS)
              .repeat()
              .doOnSubscribe { Log.v("parentObservable", "STARTED") }
              .subscribe { t: MutableList&lt;Parent&gt; -&gt;
                  Log.v("parentObservable", "onNext")
                  t.forEach { Log.v("onNext", it.toString()) }
              }
  
      Thread.sleep(30000)
      Log.v("AFTER_SLEEP", "AFTER_SLEEP")
  
  
      someClass1Observable.subscribe {
          Log.v("someClass1", it.toString())
      }
  
      someClass2Observable.subscribe {
          Log.v("someClass2", it.toString())
      }
  </code></pre>
  
  <p>The first emission of the 2 streams works fine, the merge/buffer Observable is gathering emissions from them every time after 10 seconds. However, when those 2 streams ended emissions and i subscribe to them again, the buffer/merge Observable is no loger working. How to have this work like for infinite? Is there a better way to write code for those 2 separate streams that emits objects that they will not need to read values from a list and instead of this they will emit some new object every 2 seconds interval?
  How to make the merge/buffer Observable works infinite, i mean whenever there is a new emission from those 2 Observable streams?</p>