Exemple #1
0
    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()
Exemple #2
0
    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))
Exemple #3
0
 def projection(x):
     return reactivex.interval(10).pipe(
         ops.map_indexed(lambda a, b: x), ops.take(x))
Exemple #4
0
 def create():
     return reactivex.interval(1000)