archive/v1/client/monitor.js
function taskAsync(args, result) {
		
		// format the result
		result = env.format(result);
		
		// if the delete should not be asyncronous and the task should be monitored
		if (args.async === false) {

			// set the polling period and timeout defaults
			args.delay   = !isNaN(args.delay) ? args.delay : 1000;
			args.timeout = (!isNaN(args.timeout) && args.timeout >= 0) ? args.timeout : 0;
			
			// start the monitor
			return task(result.id, args.delay, args.timeout, (new Date()).valueOf());
		}
		
		// return the result
		return result;
	}
function taskAsync(args, result) {
		
		// format the result
		result = env.format(result);
		
		// if the delete should not be asyncronous and the task should be monitored
		if (args.async === false) {

			// set the polling period and timeout defaults
			args.delay   = !isNaN(args.delay) ? args.delay : 1000;
			args.timeout = (!isNaN(args.timeout) && args.timeout >= 0) ? args.timeout : 0;
			
			// start the monitor
			return task(result.id, args.delay, args.timeout, (new Date()).valueOf());
		}
		
		// return the result
		return result;
	}
function taskAsync ( args , result ) { // format the result result = env . format ( result ) ; // if the delete should not be asyncronous and the task should be monitored if ( args . async === false ) { // set the polling period and timeout defaults args . delay = ! isNaN ( args . delay ) ? args . delay : 1000 ; args . timeout = ( ! isNaN ( args . timeout ) && args . timeout >= 0 ) ? args . timeout : 0 ; // start the monitor return task ( result . id , args . delay , args . timeout , ( new Date ( ) ) . valueOf ( ) ) ; } // return the result return result ; }
determine if the task should be monitored or to simply return the task id
determine if the task should be monitored or to simply return the task id