lib/iod.js
function(jobId) {
			var isFinished = function(res) {
				return res && res.status &&
					(res.status === 'finished' || res.status === 'failed')
			}

			var poll = function() {
				IOD.status({ jobId: jobId }, function(err, res) {
					// Emits err as first argument
					if (err) IOD.eventEmitter.emit(jobId, err)
					else if (isFinished(res)) {
						IOD.eventEmitter.emit(jobId, null, res)
						sendCallback(res)
					}
					else setTimeout(poll, IODOpts.pollInterval)
				})
			}

			setTimeout(poll, IODOpts.pollInterval)
		}
function(jobId) {
			var isFinished = function(res) {
				return res && res.status &&
					(res.status === 'finished' || res.status === 'failed')
			}

			var poll = function() {
				IOD.status({ jobId: jobId }, function(err, res) {
					// Emits err as first argument
					if (err) IOD.eventEmitter.emit(jobId, err)
					else if (isFinished(res)) {
						IOD.eventEmitter.emit(jobId, null, res)
						sendCallback(res)
					}
					else setTimeout(poll, IODOpts.pollInterval)
				})
			}

			setTimeout(poll, IODOpts.pollInterval)
		}
function ( jobId ) { var isFinished = function ( res ) { return res && res . status && ( res . status === 'finished' || res . status === 'failed' ) } var poll = function ( ) { IOD . status ( { jobId : jobId } , function ( err , res ) { // Emits err as first argument if ( err ) IOD . eventEmitter . emit ( jobId , err ) else if ( isFinished ( res ) ) { IOD . eventEmitter . emit ( jobId , null , res ) sendCallback ( res ) } else setTimeout ( poll , IODOpts . pollInterval ) } ) } setTimeout ( poll , IODOpts . pollInterval ) }
Periodically get status of a job with specified job id `jobId`.
Do so until job has finished or failed.

@param {String} jobId - Job id
Periodically get status of a job with specified job id jobId . Do so until job has finished or failed .