def get_iterator(self, missing_items=None): def data_provider(batch_number): try: return self.batches[batch_number] except IndexError: return [] itr = ResumableFunctionIterator('test', data_provider, TestArgsProvider()) itr.couch_db = self.couch_db return itr
def get_iterator(self, missing_items=None): def data_provider(batch_number): try: return self.batches[batch_number] except IndexError: return [] def item_getter(item_id): if missing_items and item_id in missing_items: return None return int(item_id) itr = ResumableFunctionIterator('test', data_provider, TestArgsProvider(), item_getter) itr.couch_db = self.couch_db return itr
def get_iterator(self, missing_items=None): def data_provider(batch_number): try: return self.batches[batch_number] except IndexError: return [] def item_getter(item_id): if missing_items and item_id in missing_items: return None return int(item_id) itr = ResumableFunctionIterator('test', data_provider, TestArgsProvider(), item_getter) itr.couch_db = self.couch_db return itr