## NativePullQueue `NativePullQueue(obj)`  Creates a new instance of NativePullQueue with the following options:
559144
function NativePullQueue(obj) {
  if (!(this instanceof NativePullQueue)) {
    return new NativePullQueue(obj);
  }

  EventEmitter.call(this);

  obj = obj || {};

  this.name = obj.name || '';
  this.type = 'pull';
  this.queue = obj.queue || null;
}
396802
function _new (args) {
    // instantiate new instance
    var instance = new ImmutableCoreComponentInstance({
        args: args,
        component: this,
    })
    // wait for initialize promise to resolve then resolve with instance
    return instance.promise.then(() => instance)
}
400703
function mergeDefaults(obj, src) {
    var objValue = Immutable.fromJS(obj);
    var srcValue = Immutable.fromJS(src);

    return srcValue.mergeDeep(objValue).toJS();
}
154355
function ( event_handler ){
    //keep track of all created instances
    //index into array will be passed around as opdata to tie
    //the event_handler to the relevant instance.
    if(!OPS_QUEUE) OPS_QUEUE = ASYNC.queue(ops_handle_event,1)

    var self = this;

    MAO.push({
        instance:self,
    });
    this._event_handler = event_handler;
    this._opsdata = _malloc(4);
    setValue(this._opsdata,MAO.length-1,"i32");
    this._pointer = jsapi_.messageappops_new();
}
21377
private Object newObj(Object obj, Element node) throws Exception {
		Class<?> oClass = nodeClass(node);
		String id = getAttribute(node, "id");
		int size = 0;
		Element[] children = getChildren(node);
		int argi = children.length;
		for (int i = 0; i < children.length; i++) {
			Element element = children[i];

			if (!(element.getTagName().equals("Arg"))) {
				argi = i;
				break;
			}
			size++;
		}

		//CHECKSTYLE:OFF
		Object[] arg = new Object[size];
		for (int i = 0, j = 0; j < size; i++) {
			Element o = children[i];
			arg[j++] = value(obj, o);
		}
		//CHECKSTYLE:ON

		if (LOG.isDebugEnabled()) {
			LOG.debug("XML new " + oClass);
		}

		// Lets just try all constructors for now
		Constructor<?>[] constructors = oClass.getConstructors();
		for (int c = 0; constructors != null && c < constructors.length; c++) {
			if (constructors[c].getParameterTypes().length != size) {
				continue;
			}

			Object n = null;
			boolean called = false;
			try {
				n = constructors[c].newInstance(arg);
				called = true;
			} catch (IllegalAccessException e) {
				if (LOG.isInfoEnabled()) {
					LOG.info(
							"IllegalAccessException while parsing jetty-web.xml",
							e);
				}
			} catch (InstantiationException e) {
				if (LOG.isInfoEnabled()) {
					LOG.info(
							"InstantiationException while parsing jetty-web.xml",
							e);
				}
			} catch (IllegalArgumentException e) {
				if (LOG.isInfoEnabled()) {
					LOG.info(
							"IllegalArgumentException while parsing jetty-web.xml",
							e);
				}
			}
			if (called) {
				if (id != null) {
					_idMap.put(id, n);
				}
				configure(n, node, argi);
				return n;
			}
		}

		throw new IllegalStateException("No Constructor: " + node + " on "
				+ obj);
	}
865830
function(implClass, modClass) {

	var impls = {
		DelayableQueue : [

			/**
			 * Returns a queueable interface to the original object
			 * This allows us to insert delays between chainable method calls using the .wait() method
			 * Currently this is only implemented for the node class, but it should be possible to use this with any object.
			 */
			'wait', function () {

				/**
				 * Queueable object which implements methods from another interface
				 * @param object Context for the callback
				 */
				function QueueableObject(context) {
					this.queue = [];
					this.context = context;
					this.inWork = false;
				}
				
				QueueableObject.prototype = {
					_add: function(func, args) {

						var self = this;

						self.queue.push({type: 'chain', func: func, args: args});
						if (!self.inWork) {
							return self._process();
						}
					},

					/**
					 * Process the queue
					 * Shifts an item off the queue and waits for it to finish
					 */
					_process: function() {

						var self = this, item;

						self.inWork = true;
						
						if (!self.queue.length) {
							return;
						}
						
						item = self.queue.shift();

						if (item.type == 'wait') {
							setTimeout(function(){
								self._process();
							}, item.duration*1000);
						} else {
							self.context = item.func.apply(self.context, item.args);
							self._process();
						}
						return self;
					},

					/**
					 * Updates the current delay timer
					 */
					wait: function(duration) {
						this.queue.push({type: 'wait', duration: duration});
						return this;
					}
				};
				
				return function (duration) {

					var self = this,
						mockObj = new QueueableObject(self);

					/**
					 * Returns an executable function
					 * uses setTimeout and the total queueTimer
					 */
					getQueuedFunction = function(func) {
						return function() {
							mockObj._add(func, arguments);
							return mockObj;
						}
					};

					/**
					 * Wrap all class functions
					 * We can unwrap at the end if the current wait is 0
					 */
					for( var i in self ) {
						if (typeof self[i] != 'function' || i == 'wait' ) { continue; }
						mockObj[i] = getQueuedFunction(self[i]);
					}

					mockObj.wait(duration);
					
					return mockObj;
				}
			}
		]
	};

	modClass[impls[implClass][0]] = impls[implClass][1]();
}
637805
public Scriptable wrapNewObject(Context cx, Scriptable scope, Object obj)
    {
        if (obj instanceof Scriptable) {
            return (Scriptable)obj;
        }
        Class<?> cls = obj.getClass();
        if (cls.isArray()) {
            return NativeJavaArray.wrap(scope, obj);
        }
        return wrapAsJavaObject(cx, scope, obj, null);
    }
856629
function Queue(owner, that) {
		this._methods = [];
		this._owner = owner;
		this._that = that;
		this._paused = false;
	}
161253
@Override
    public void visitCode(Code obj) {

        Method m = getMethod();
        if (m.isSynthetic()) {
            return;
        }

        if (isEnum && "values".equals(m.getName())) {
            return;
        }

        String sig = m.getSignature();
        int sigPos = sig.indexOf(")[");
        if (sigPos < 0) {
            return;
        }
        if (INITIAL_VALUE.equals(m.getName())) {
            try {
                if ((THREAD_LOCAL_CLASS == null) || getClassContext().getJavaClass().instanceOf(THREAD_LOCAL_CLASS)) {
                    return;
                }
            } catch (ClassNotFoundException e) {
                bugReporter.reportMissingClass(e);
                return;
            }
        }

        stack.resetForMethodEntry(this);
        returnArraySig = sig.substring(sigPos + 1);
        uninitializedRegs.clear();
        arrayAliases.clear();
        storedUVs.clear();
        super.visitCode(obj);
    }
1246940
def ObjectInitializedEventHandler(obj, event):
    

    # only snapshot supported objects
    if not supports_snapshots(obj):
        return

    # object has already snapshots
    if has_snapshots(obj):
        return

    # take a new snapshot
    take_snapshot(obj, action="create")
641879
function WorkQueue(obj) {
  if (!(this instanceof WorkQueue)) {
    return new WorkQueue(obj);
  }

  obj = obj || {};

  this.work = [];
  this.workers = [];
  this.nextWorker = 0;
}
738314
function createNativeEvent(type, debug) {
        var event = new Event(type);
        event.debug = debug;

        // Make the "target" writable
        Object.defineProperty(event, 'target', {
            writable: true
        });

        return event;
    }
758678
public function initializeObject()
    {
        $this->queue = new \SplQueue();

        $this->synchronousEventMap  = $this->cache->get('DispatcherConfiguration_Synchronous');
        $this->asynchronousEventMap = $this->cache->get('DispatcherConfiguration_Asynchronous');

        if (FALSE === ($this->synchronousEventMap || $this->asynchronousEventMap))
        {
            $this->buildEventMap();

            $this->cache->set('DispatcherConfiguration_Asynchronous', $this->asynchronousEventMap);
            $this->cache->set('DispatcherConfiguration_Synchronous', $this->synchronousEventMap);
        }
    }
296803
public static <E> Queue<E> createStack(int initSize) {
		return Collections.asLifoQueue(new ArrayDeque<E>(initSize));
	}
914493
private Object newObj(Object obj, XmlParser.Node node) throws NoSuchMethodException,
            ClassNotFoundException, InvocationTargetException, IllegalAccessException
    {
        Class oClass = nodeClass(node);
        String id = node.getAttribute("id");
        int size = 0;
        int argi = node.size();
        for (int i = 0; i < node.size(); i++)
        {
            Object o = node.get(i);
            if (o instanceof String) continue;
            if (!((XmlParser.Node) o).getTag().equals("Arg"))
            {
                argi = i;
                break;
            }
            size++;
        }

        Object[] arg = new Object[size];
        for (int i = 0, j = 0; j < size; i++)
        {
            Object o = node.get(i);
            if (o instanceof String) continue;
            arg[j++] = value(obj, (XmlParser.Node) o);
        }

        if (log.isDebugEnabled()) log.debug("new " + oClass);

        // Lets just try all constructors for now
        Constructor[] constructors = oClass.getConstructors();
        for (int c = 0; constructors != null && c < constructors.length; c++)
        {
            if (constructors[c].getParameterTypes().length != size) continue;

            Object n = null;
            boolean called = false;
            try
            {
                n = constructors[c].newInstance(arg);
                called = true;
            }
            catch (IllegalAccessException e)
            {
                LogSupport.ignore(log, e);
            }
            catch (InstantiationException e)
            {
                LogSupport.ignore(log, e);
            }
            catch (IllegalArgumentException e)
            {
                LogSupport.ignore(log, e);
            }
            if (called)
            {
                if (id != null) _idMap.put(id, n);
                configure(n, node, argi);
                return n;
            }
        }

        throw new IllegalStateException("No Constructor: " + node + " on " + obj);
    }
1285408
public void flushQueue() {
        /*
            Basically we just want to form GridOp and pass it to native executioner
            But since we don't have GridOp interface yet, we'll send everything to underlying CudaExecutioner.
         */
        //    logger.info("Non-Blocking flush");
        // TODO: proper implementation for GridOp creation required here
        /*
        Deque<OpDescriptor> currentQueue = deviceQueues.get();
        if (currentQueue == null)
            return;
        
        OpDescriptor op = currentQueue.pollFirst();
        while (op != null) {
            pushToGrid(op, false);
        
            op = currentQueue.pollFirst();
        }
        */

        // we need to check,
        OpDescriptor op = lastOp.get();
        if (op != null) {
            if (!experimental.get()) {
                //if (!nativeOps.isExperimentalEnabled()) {
                // it might be only pairwise transform here for now
                //          logger.info("Flushing existing lastOp");
                lastOp.remove();
                dequeueOp(op);
                pushToGrid(op, false);
            } else {
                throw new UnsupportedOperationException("Experimental flush isn't supported yet");
            }
        } else {
            //      logger.info("Queue is empty");

        }
    }
996802
function (obj, type, handler, id) {

		switch (type) {
		case 'touchstart':
			return this.addPointerListenerStart(obj, type, handler, id);
		case 'touchend':
			return this.addPointerListenerEnd(obj, type, handler, id);
		case 'touchmove':
			return this.addPointerListenerMove(obj, type, handler, id);
		default:
			throw 'Unknown touch event type';
		}
	}