checkJob(context, result){
    //store the result
    context.job=result;

    //if the response is a redirect then act on it and get the final result
    if (result[0].statusCode===303) {
      return this.getResult;
    }

    //otherwise if the body contains a property 'location' then get the job after a delay
    if (result[1] && result[1].location) {
      return ryle.onTimeout(250,this.getJob);
    }

    //otherwise the result was unexpected so throw an error
    throw new Error('Unexpected response');
  }
//check the result of either the POST or GET
check the result of either the POST or GET
check the result of either the POST or GET
checkJob(context, result){
    context.job=result;
    if (result[0].statusCode===303) {
      return this.getResult;
    }
    if (result[1] && result[1].location) {
      return ryle.onTimeout(250,this.getJob);
    }
    throw new Error('Unexpected response');
  }
checkJob ( context , result ) { context . job = result ; if ( result [ 0 ] . statusCode === 303 ) { return this . getResult ; } if ( result [ 1 ] && result [ 1 ] . location ) { return ryle . onTimeout ( 250 , this . getJob ) ; } throw new Error ( 'Unexpected response' ) ; }
check the result of either the POST or GET
check the result of either the POST or GET
//store the result //if the response is a redirect then act on it and get the final result //otherwise if the body contains a property 'location' then get the job after a delay //otherwise the result was unexpected so throw an error