Usage: [finished_index, results, logs] = jcmwave_daemon_wait4any([job_ids], [resultbag], [options])

Purpose: waits until one job from a list of jobs (given by job_ids)
         has finished. The finished job is released from the daemon, so that
         its job id is invalidated.

  job_ids -> integer vector of job identifier as returned by jcmwave_solve
             If missing or empty all job ids available on the daemon are used.
             A zero job id is treated as a dummy.

  resultbag -> An instance of the class jcmwave_resultbag. The result is added
       to the result bag. If the corresponding jcmwave_solve() command was not
       called with the resultbag parameter an error will be thrown.

  options -> key value list (or structure) with the following optional arguments:
    options.info_level -> integer to set level of progress reporting. [default=1]
    options.timeout ->  Time out in seconds (optional)
                        This script returns with empty output values, when the
                        time out is reached. b

      finished_index: -> index of the passed job_ids vector corresponding
        to the finished job, e.g. job_ids[finished_index] is the job id
        of the finished job.
      results -> computed results for the finished job
      logs -> log messages of the finished job

      In case of a timeout finished_index=0 is returned. No job is released
      from the daemon.

      If a resultbag is passed results and logs are stored in the resultbag and
      not returned.