예제 #1
0
    def test_range_double_subscribe(self):
        scheduler = TestScheduler()
        obs = reactivex.range(1, 4)

        results = scheduler.start(lambda: obs.pipe(ops.concat(obs)))
        assert results.messages == [
            on_next(200, 1),
            on_next(200, 2),
            on_next(200, 3),
            on_next(200, 1),
            on_next(200, 2),
            on_next(200, 3),
            on_completed(200),
        ]
예제 #2
0
 def create():
     return reactivex.range(0, 10, 2)
예제 #3
0
 def create():
     return reactivex.range(5)
예제 #4
0
 def create():
     return reactivex.range(-10, 5)
예제 #5
0
 def create():
     return reactivex.range(10, 15)
예제 #6
0
 def test_run_range_to_iterable(self):
     result = reactivex.range(42).pipe(ops.to_iterable()).run()
     assert list(result) == list(range(42))
예제 #7
0
 def test_run_range(self):
     result = reactivex.range(42).run()
     assert result == 41
예제 #8
0
async def go(loop):
    scheduler = AsyncIOScheduler(loop)

    ai = reactivex.range(0, 10, scheduler=scheduler).pipe(to_async_iterable())
    async for x in ai:
        print("got %s" % x)