Example #1
0
    def on_error(self, error):
        check_disposed(self)
        self.has_failed = True
        self.error = error

        if not self.enable_queue or not len(self.queue):
            self.subject.on_error(error)
Example #2
0
    def on_error(self, error):
        check_disposed(self)
        self.has_failed = True
        self.error = error

        if not self.enable_queue or not len(self.queue):
            self.subject.on_error(error)
Example #3
0
    def on_next(self, value):
        check_disposed(self)

        self.observer.on_next(value)

        def action(scheduler, state):
            self.observable.source.request(1)
        self.scheduler.schedule(action)
Example #4
0
    def on_next(self, value):
        check_disposed(self)

        self.observer.on_next(value)

        def action(scheduler, state):
            self.observable.source.request(1)
        self.scheduler.schedule(action)
Example #5
0
        def on_next(self, value):
            check_disposed(self)
            self.observer.on_next(value)

            def action(scheduler, state):
                log.debug('requested size: %s', self.observable.window_size)
                self.observable.source.request(self.observable.window_size)

            self.received = (self.received + 1) % self.observable.window_size
            if self.received == 0:
                self.scheduler.schedule(action)
Example #6
0
        def on_next(self, value):
            check_disposed(self)
            self.observer.on_next(value)

            def action(scheduler, state):
                log.debug('requested size: %s', self.observable.window_size)
                self.observable.source.request(self.observable.window_size)

            self.received = (self.received+1) % self.observable.window_size
            if self.received == 0:
                self.scheduler.schedule(action)
Example #7
0
    def request(self, number):
        check_disposed(self)
        self.dispose_current_request()

        r = self._process_request(number)
        number = r["number_of_items"]
        if not r["return_value"]:
            self.requested_count = number

            def action():
                self.requested_count = 0
            self.requested_disposable = Disposable(action)

            return self.requested_disposable
        else:
            return Disposable.empty()
Example #8
0
    def request(self, number):
        check_disposed(self)
        self.dispose_current_request()

        r = self._process_request(number)
        number = r["number_of_items"]
        if not r["return_value"]:
            self.requested_count = number

            def action():
                self.requested_count = 0

            self.requested_disposable = Disposable(action)

            return self.requested_disposable
        else:
            return Disposable.empty()
Example #9
0
    def on_next(self, value):
        check_disposed(self)
        has_requested = False

        if not self.requested_count:
            if self.enable_queue:
                self.queue.push(value)
        else:
            if self.requested_count != -1:
                requested_count = self.requested_count
                self.requested_count -= 1
                if requested_count == 0:
                    self.dispose_current_request()

            has_requested = True

        if has_requested:
            self.subject.on_next(value)
Example #10
0
    def on_next(self, value):
        check_disposed(self)
        has_requested = False

        if not self.requested_count:
            if self.enable_queue:
                self.queue.push(value)
        else:
            if self.requested_count != -1:
                requested_count = self.requested_count
                self.requested_count -= 1
                if requested_count == 0:
                    self.dispose_current_request()

            has_requested = True

        if has_requested:
            self.subject.on_next(value)
Example #11
0
 def on_error(self, error):
     check_disposed(self)
     self.observer.on_error(error)
     self.dispose()
Example #12
0
 def on_completed(self):
     check_disposed(self)
     self.observer.on_completed()
     self.dispose()
Example #13
0
 def on_error(self, error):
     check_disposed(self)
     self.observer.on_error(error)
     self.dispose()
Example #14
0
 def on_completed(self):
     check_disposed(self)
     self.observer.on_completed()
     self.dispose()
Example #15
0
    def on_completed(self):
        check_disposed(self)
        self.has_completed = True

        if not self.enable_queue or not len(self.queue):
            self.subject.on_completed()
Example #16
0
    def on_completed(self):
        check_disposed(self)
        self.has_completed = True

        if not self.enable_queue or not len(self.queue):
            self.subject.on_completed()