简单的任务队列
@param options
@constructor
174574
function JobQueue(options){
    Event.EventEmitter.call(this);
    this.targetValue = [];
    this.state = STATE.IDLE;
    this.consumer = options.consumer;
    this.paused = false;
    this.interval = options.interval || 0;
    this.timeout = options.timeout || 100;
    this.timehandle = null;
    let self = this;
    this.run = function(){

        if(this.paused){
            if(this.timehandle){
                clearTimeout(this.timehandle);
                this.timehandle = null;
            }
            this.timehandle = setTimeout(function(){
                self.state = STATE.IDLE;
                self.run();
            },this.timeout);
        }else{
            if (self.targetValue && self.targetValue.length > 0) {
                if(self.state === STATE.IDLE){
                    let target = self.targetValue.shift();
                    if (self.consumer ) {
                        self.state = STATE.BUSY;

                        self.__worker= Q().then(function(){
                            //队列中的所有的待写入操作返回

                            return self.consumer(target.handle);
                        }).then(function(value){
                            if(target.uuid){
                                self.emit('resp-'+target.uuid,{success:true,result:value})
                            }
                            if(self.timehandle){
                                clearTimeout(self.timehandle);
                                self.timehandle = null;
                            }

                            self.timehandle =setTimeout(function(){
                                self.state = STATE.IDLE;
                                self.run();
                            },self.interval)


                        }).catch(function(e){
                            if(target.uuid){
                                self.emit('resp-'+target.uuid,{success:false,reason:e});
                            }
                            //    console.error('error in writing Value:',e); // 这个不应该出现,只有在非正常的情况下才会如此

                            if(self.targetValue.length > 0){
                                if(self.timehandle){
                                    clearTimeout(self.timehandle);
                                    self.timehandle = null;
                                }
                                self.timehandle =setTimeout(function(){
                                    self.state = STATE.IDLE;
                                    self.run();
                                },self.timeout)

                            }else{
                                self.state = STATE.IDLE;
                            }
                        });
                    }
                }

            }else{
                self.state = STATE.IDLE;
            }
        }


    }
}
638049
function IteratorOptions(options) {
  this.gte = null;
  this.lte = null;
  this.keys = true;
  this.values = false;
  this.fillCache = false;
  this.keyAsBuffer = true;
  this.valueAsBuffer = true;
  this.reverse = false;
  this.highWaterMark = 16 * 1024;

  // Note: do not add this property.
  // this.limit = null;

  if (options)
    this.fromOptions(options);
}
706872
function initOptions(options, defaults) {
        options || (options = {});
        if (!defaults) {
            return options;
        }
        for (var i in defaults) {
            if (typeof options[i] === 'undefined') {
                options[i] = defaults[i];
            }
        }
        return options;
    }
442597
function(a, b) {
            c = this;
            if (!b) {
                return c.options[a];
            } else {
                c._u(a, b);
            }
        }
568852
function defaults(options, defaultOptions) {
  options || (options = {});

  for (var opt in defaultOptions) {
    if (defaultOptions.hasOwnProperty(opt) && !options.hasOwnProperty(opt)) {
      options[opt] = defaultOptions[opt];
    }
  }

  return options;
}
33512
function(options){
	this.dom = [];
	this.fillColor='black';
	this.strokeColor='black';
	this.strokeWidth=1;
	this.unit='mm';
	this.width=100;
	this.height=100;

	for(var optionName in options){
		this[optionName]=options[optionName];
	}
}
1059647
function Client(options) {
    if (typeof options === 'object') {
      if (options.AccessKeyId && options.AccessKeySecret) {
        _.assign(this.options, options);
      } else {
        throw new Error('请设置AccessKeyId和AccessKeySecret');
      }
    } else {
      throw new Error('实例化参数类型不正确');
    }
  }
1089444
function parseOptions(options) {
  let opts = {};

  _.each(nodecipher.defaults, (defaultVal, name) => {
    if (!_.isUndefined(options[name])) {
      opts[name] = options[name];
    }
  });

  return opts;
}
773220
function(options) {
      
      inputEx.TimeIntervalField.superclass.setOptions.call(this,options);
      
      var units = inputEx.TimeIntervalField.units;
      var unitsStr = inputEx.messages.timeUnits;
      
      this.options.unit = options.unit || units.SECOND;
      
      
      var n=[]; for(var i=1;i<=60;i++){ n.push({ value : i }); }
      
      this.options.fields = options.fields || [
         {type: 'select', choices: n },
         {
            type: 'select',
            choices: [
               { value: units.SECOND, label: unitsStr.SECOND },
               { value: units.MINUTE, label: unitsStr.MINUTE },
               { value: units.HOUR, label: unitsStr.HOUR },
               { value: units.DAY, label: unitsStr.DAY },
               { value: units.MONTH, label: unitsStr.MONTH },
               { value: units.YEAR, label: unitsStr.YEAR }
            ]
         }
      ];
      
      this.options.separators = options.separators || [false, "&nbsp;&nbsp;", false];
   }
711611
function createOptions( options ) {
    var object = optionsCache[ options ] = {};
    _each( options.split( /\s+/ ), function( flag ) {
      object[ flag ] = true;
    });
    return object;
  }
899111
function optionBuilder(options) {
  options = options || {};

  var results = {stdin: [], args: [], files: []};
  Object.keys(options).map(function (option) {
    var p4option = p4options[option];
    if (!p4option) return;
    if (p4option.category !== 'unary') {
      if ((options[option] || {}).constructor !== p4option.type) return;
    }
    if (p4option.category === 'stdin') {
      results.stdin.push(p4option.cmd + options[option]);
      if (results.args.indexOf('-i') < 0) results.args.push('-i');
    } else if (p4option.cmd) {
      results.args.push(p4option.cmd);
      if (p4option.category === 'mixed') results.args.push(options[option]);
    } else {
      results.files = results.files.concat(options[option]);
    }
  });
  return results;
}
158089
function Combo(options) {
    this.options = _.extend({
        domain: 'imgcache.gtimg.cn',
        basePath: '/c/=',
        separator: ',',
        selectors: {
            script: /<(script)([^>]*)>((?:.|\r\n)*?)<\/script>/g,
            link: /<(link)([^>]*?)\/?>/g
        }
    }, options);
}
1075443
async function storeOptions(options){
    await _fs.writeFile(_configFilename, JSON.stringify(options, null, 4));
}
343850
function(options)
	{
		options = conbo.defineDefaults(options, this.options);
		
		if (!!options.context) this.context = options.context;
		this.preinitialize(options);
		
		this._httpService = new conbo.HttpService(options);
		this._command = options.command;
		
		var resultHandler = function(event)
		{
			conbo.makeBindable(this, conbo.variables(event.result));
			conbo.assign(this, event.result);
			
			this.dispatchEvent(event);
		};
		
		this._httpService
			.addEventListener(conbo.ConboEvent.RESULT, resultHandler, this)
			.addEventListener(conbo.ConboEvent.FAULT, this.dispatchEvent, this);
		
		__denumerate(this);
		
		conbo.Hash.prototype.__construct.apply(this, arguments);
	}
631694
function NjsCompiler(options) {
    this.nodeSequence = 0;
    this.options = options || {};
    if (!this.options.runtime) {
        this.options.runtime = 'njs';
    }
    this.parseBooleanOptions("exceptions", true);
}
634898
function createOptions( options ) {
	var object = optionsCache[ options ] = {};
	jQuery.each( options.split( core_rspace ), function( _, flag ) {
		object[ flag ] = true;
	});
	return object;
}
266977
function IteratorOptions(options) {
  this.keys = true;
  this.values = true;
  this.start = null;
  this.end = null;
  this.gt = false;
  this.lt = false;
  this.keyAsBuffer = true;
  this.valueAsBuffer = true;
  this.reverse = false;
  this.limit = -1;

  if (options)
    this.fromOptions(options);
}