code: def consume_results(self):
          queue_size = self.waiting_results.qsize()
          for _ in range(queue_size):
              self.manage_results(self.waiting_results.get())
          for chk in list(self.checks.values()):
              if chk.status == ACT_STATUS_WAIT_CONSUME:
                  logger.debug("Consuming: %s", chk)
                  item = self.find_item_by_id(chk.ref)
                  notification_period = None
                  if getattr(item, 'notification_period', None) is not None:
                      notification_period = self.timeperiods[item.notification_period]
                  dep_checks = item.consume_result(chk, notification_period, self.hosts,
                                                   self.services, self.timeperiods,
                                                   self.macromodulations, self.checkmodulations,
                                                   self.businessimpactmodulations,
                                                   self.resultmodulations, self.checks,
                                                   self.pushed_conf.log_active_checks and
                                                   not chk.passive_check)
                  for check in dep_checks:
                      logger.debug("-> raised a dependency check: %s", chk)
                      self.add(check)
          have_resolved_checks = True
          while have_resolved_checks:
              have_resolved_checks = False
              for chk in list(self.checks.values()):
                  if chk.status == ACT_STATUS_WAITING_ME:
                      for dependent_checks in chk.depend_on_me:
                          dependent_checks.depend_on.remove(chk.uuid)
                          have_resolved_checks = True
                      chk.status = ACT_STATUS_ZOMBIE
              for chk in list(self.checks.values()):
                  if chk.status == ACT_STATUS_WAIT_DEPEND and not chk.depend_on:
                      item = self.find_item_by_id(chk.ref)
                      notification_period = None
                      if getattr(item, 'notification_period', None) is not None:
                          notification_period = self.timeperiods[item.notification_period]
                      dep_checks = item.consume_result(chk, notification_period, self.hosts,
                                                       self.services, self.timeperiods,
                                                       self.macromodulations, self.checkmodulations,
                                                       self.businessimpactmodulations,
                                                       self.resultmodulations, self.checks,
                                                       self.pushed_conf.log_active_checks and
                                                       not chk.passive_check)
                      for check in dep_checks:
                          self.add(check)