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)
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)
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)
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)
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()
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)
def on_error(self, error): check_disposed(self) self.observer.on_error(error) self.dispose()
def on_completed(self): check_disposed(self) self.observer.on_completed() self.dispose()
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()