def get(self, block=False, timeout=None): """ Get next item from queue """ if self.empty() or self.qsize() < 50: self.load_data() if self.empty(): raise Queue.Empty return WSJob.get(self, block, timeout)
def get(self, block=True, timeout=None): """ Get next element from queue """ if self.empty(): while self.get_blocked: time.sleep(1) self.get_blocked = True self._fill_queue() self.get_blocked = False if self.empty(): raise Queue.Empty return WSJob.get(self, block, timeout)