def get_next_of_type(self, processor_type):
        with self._condition:
            if processor_type not in self:
                self.wait_for_registration(processor_type)
            try:
                processor = self[processor_type].next_processor()
            except NoProcessorVacancyError:
                processor = self.wait_for_vacancy(processor_type)
            processor.inc_occupancy()
            return processor