def schedule (self):
		try:
			# read at least on message per process if there is some and parse it
			for service,command in self.processes.received():
				self.api.text(self,service,command)

			# if we have nothing to do, return or save the work
			if not self._running:
				if not self._pending:
					return False
				self._running,name = self._pending.popleft()
				self.logger.reactor('callback | installing %s' % name)

			if self._running:
				# run it
				try:
					self.logger.reactor('callback | running')
					self._running.next()  # run
					# should raise StopIteration in most case
					# and prevent us to have to run twice to run one command
					self._running.next()  # run
				except StopIteration:
					self._running = None
					self.logger.reactor('callback | removing')
				return True

		except StopIteration:
			pass
		except __HOLE__:
			self._shutdown = True
			self.logger.reactor('^C received','error')
dataset/ETHPy150Open Exa-Networks/exabgp/lib/exabgp/reactor/loop.py/Reactor.schedule