jobs[id] = self._jobs.pop(id)
while len(ids) > 0: # wait for outstanding jobs
job = self._receive_job()
- log().debug('receive job %s (%s)' % (job, job.status))
- job.copy_onto(self._jobs[job.id])
+ self._handle_received_job(job)
if job.id in ids and job.id in self._jobs:
jobs[job.id] = self._jobs.pop(job.id)
ids.remove(job.id)
return jobs
+ def _handle_received_job(self, job):
+ log().debug('receive job %s (%s)' % (job, job.status))
+ job.copy_onto(self._jobs[job.id])
+
def _receive_job(self):
raise NotImplementedError
return False
def _spawn_job(self, job):
- self._receive_job(block=False)
+ j = self._receive_job(block=False)
+ if j != None:
+ self._handle_received_job(j)
if self._job_is_blocked(job):
log().debug('block job %s' % job)
self._blocked.append(job)