code: def dispatch_job(self, link, key, job_archive, stream=sys.stdout):
          
          try:
              job_details = link.jobs[key]
          except KeyError:
              print(key, link.jobs)
          job_config = job_details.job_config
          link.update_args(job_config)
          logfile = job_config['logfile']
          try:
              self.dispatch_job_hook(link, key, job_config, logfile, stream)
              job_details.status = JobStatus.running
          except IOError:
              job_details.status = JobStatus.failed
  
          if job_archive is not None:
              job_archive.register_job(job_details)
          return job_details
docs: Function to dispatch a single job
  
          Parameters
          ----------
  
          link : `Link`
              Link object that sendes the job
  
          key : str
              Key used to identify this particular job
  
          job_archive : `JobArchive`
              Archive used to keep track of jobs
  
          Returns `JobDetails` object