Why repeat(n) does not work with create in Reactive extensions
<pre><code>from rx import Observable, Observer
from __future__ import print_function
import random

def create_observable(observer):
    while True:
        observer.on_next(random.randint(1,100))    

Observable.create(create_observable).take_while(lambda x: x&gt;50).repeat(6).subscribe(print)
</code></pre>

<p>gives</p>

<blockquote>
  <p>74 78 94 59 79 76</p>
</blockquote>

<p>sequence, while I'm expecting each number will be repeated 6 times</p>

<p>so "repeat" never works for observables created with create method.</p>

<p>The posted code gets 6 times a sequence of random integers in the range [51, 100].</p>

<p>Try with </p>

<pre><code>(Observable.create(create_observable)
    .take_while(lambda x: x &gt; 50)
    .select_many(lambda x: Observable.just(x).repeat(6))
    .subscribe(print))
</code></pre>

<p>or just </p>

<pre><code>(Observable.create(create_observable)
    .take_while(lambda x: x &gt; 50)
    .select_many(lambda v: [v] * 6)
    .subscribe(print))
</code></pre>

python reactivex rx-py