Prepare callback
424085
function(mqtt_message) {
        var f = JSON.parse(mqtt_message);
        if (f.id===m.id && f.type==='response') {
            callback(f.payload);
            nut.mqtt_client.unsubscribe(padded_channel, mqtt_cb);
        }
    }
1164067
function ready() {

    if (!readyFired) {

        // this must be set to true before we start calling callbacks
        readyFired = true;
        var result = null;
        var i = i || 0;

        var handleEvent = function (i, readyList) {

            if ( readyList[i] ) {

                if (readyList[i].name == 'gina') {

                    var scheduler = window.setInterval(function (i, readyList) {
                        try {

                            readyList[i].ctx = window.gina;
                            result = readyList[i].fn.call(window, readyList[i].ctx);

                            // clear
                            if (result) {
                                window.clearInterval(scheduler);
                                ++i;
                                handleEvent(i, readyList)
                            }
                        } catch (err) {
                            window.clearInterval(scheduler);
                            throw err
                        }

                    }, 50, i, readyList);


                } else {
                    readyList[i].fn.call(window, readyList[i].ctx);
                    ++i;
                    handleEvent(i, readyList)
                }

            } else { // end
                // allow any closures held by these functions to free
                readyList = [];
            }
        }

        handleEvent(i, readyList)
    }
}
263316
public static function prepareHotReload() {
		if (Yesf::app()->getEnvironment() === 'develop' && function_exists('inotify_init')) {
			self::$_hot_reload_lock = new \Swoole\Lock(SWOOLE_MUTEX);
		}
	}
1039743
function onload() {
		// Create pattern
		pattern = ctx.createPattern(img, params.repeat);
		// Run callback function if defined
		if (params.load) {
			params.load.call($canvases[0], pattern);
		}
	}
60143
def _handle_callback(self, data):
        """"""

        cb_id = data.get("id")
        args = data.get("args")
        event = self.__callbacks.pop(cb_id, None)
        if not event:
            return
        if not args:
            event.put(args)
            return
        err, info = args
        if err is None:
            event.put(info)
        else:
            LOGGER.warning("Callback returned error of %s", str(err))
            event.put(err)
1211544
def add_loaded_callback(self, callback):
        """"""
        if callback not in self._cb_aldb_loaded:
            self._cb_aldb_loaded.append(callback)
254823
function callbacks(input, checked, callback, keep) {
    if (!keep) {
      if (checked) {
        input[_callback]('ifToggled');
      };

      input[_callback]('ifChanged')[_callback]('if' + capitalize(callback));
    };
  }
372219
function whenReady(callback) {

		function onLoaded() {
			document.removeEventListener( "DOMContentLoaded", onLoaded, false );
			callback();
		}

		if ( document.readyState === 'complete' ) {
			callback();
		} else {
			document.addEventListener( "DOMContentLoaded", onLoaded, false );
		}
	}
352740
function() {
		var c = this._callback;
		var p = this._pointer;
		if (c) {
			this.then(null, null);
			c.apply(p, arguments);
		} else {
			this._now = true;
		}
	}
87077
function callbackMiddleware (req, res, next) {
  if (req.url.indexOf('callback') === -1) {
    next()
  } else if (req.url.indexOf('error') === -1) {
    res.status(200).jsonp({ created: true })
  } else {
    res.status(400).jsonp({ error: true })
  }
}
1107346
function makeCallback(callback) {
  if (_.isFunction(callback)) {
    return callback;
  }
  var result = function() { return callback; };
  result._callback = callback;
  return result;
}
1267123
function wait_loading(callback) {
		var undefined,
		    events = 0,
		    foreach_loading = true,
		    errors = [];
		
		function do_end() {
			callback( (errors.length === 0) ? undefined : 'Errors:\n * ' + errors.join(' * \n') );
		}
		
		foreach(_dirs_loading).do(function(e, id) {
			events++;
			e.on('end', function(err) {
				if(err) errors.push(err);
				events--;
				if( (!foreach_loading) && (events === 0) ) do_end();
			});
		});
		
		foreach_loading = false;
		if(events === 0) do_end();
	}
1071471
function domReady(callback) {
    if (doc.readyState === "complete" || (doc.readyState !== "loading" && !doc.documentElement.doScroll))
        setTimeout(() => callback && callback(), 0)
    else {
        let handler = () => {
            doc.removeEventListener("DOMContentLoaded", handler, false)
            win.removeEventListener("load", handler, false)
            callback && callback()
        }
        doc.addEventListener("DOMContentLoaded", handler, false)
        win.addEventListener("load", handler, false)
    }
}
946201
function Ready()
	{
		if (options.autoconnect)
		{
			// make a connection request immediately (optional)
			parent.GetPSN(true, function() {
				if (options.onReady) options.onReady();
				return;
			});
		}
		else
		{
			// just callback that we're ready (if anyone is listening)
			if (options.onReady) options.onReady();
			return;
		}
	}
1085551
function prepare (o) {
    try {
      var input = checkInput(o)
      var q = Queries.mkQuery(input)

      // we have win!
      return [q]
    } catch (err) {
      // other than spewing, we ignore errors
      console.error(err.stack)

      // so this request will be flatmapped away
      return []
    }
  }
30119
def bind(self, callback):
        
        handlers = self._handlers
        if self._self is None:
            raise RuntimeError('%s already fired, cannot add callbacks' % self)
        if handlers is None:
            handlers = []
            self._handlers = handlers
        handlers.append(callback)
593122
def set_callback(self, ref, callback):
        
        # if the callback already exists, remove it
        self.remove_callback(ref)

        # add it to the callbacks
        if callback is not None:
            self._callbacks[ref] = callback