All Products
Search
Document Center

poll

Last Updated: May 14, 2018

Parameter description

Attribute Type Description
job_ids str, tuple, or list List of job IDs
timeout int Timeout after which all unfinished jobs will be stopped
interval int Minimum interval at which all job states are checked. The default value is 3 seconds

Response description

The poll method returns a list object, which contains the failure or timeout information of jobs. The null value indicates that no error occurs. If the poll method is called, its return value must be checked.

Example

  1. try:
  2. client = Client(...
  3. ...
  4. job_ids = ["job-xxxx", "job-yyyy", "job-zzzz"]
  5. # Wait all job finished.
  6. errs = client.poll(job_ids)
  7. if errs: print ("Some errors occur: %s" % '\n'.join(errs))
  8. except ClientError, e:
  9. print(e)