def test_interval_timespan_observer_throws(self): scheduler = TestScheduler() xs = reactivex.interval(1) xs.subscribe(lambda x: _raise("ex"), scheduler=scheduler) with self.assertRaises(RxException): scheduler.start()
def sample(source: Observable[_T]) -> Observable[_T]: """Samples the observable sequence at each interval. Examples: >>> res = sample(source) Args: source: Source sequence to sample. Returns: Sampled observable sequence. """ if isinstance(sampler, abc.ObservableBase): return sample_observable(source, sampler) else: return sample_observable( source, reactivex.interval(sampler, scheduler=scheduler))
def projection(x): return reactivex.interval(10).pipe( ops.map_indexed(lambda a, b: x), ops.take(x))
def create(): return reactivex.interval(1000)