Callback is called when process is started
967829
public function start($callback = null){
    if(self::$os === "linux" || self::$os === "mac"){
      return $this->startOnNix($callback);
    }else if(self::$os === "windows"){
      return $this->startOnWindows($callback);
    }
  }
1328427
protected function onInit()
    {
        if (is_array($this->params)) {
            foreach ($this->params as $cName => $cMap) {
                $cFunc = Utility::get($cMap, "{func}");
                if (is_callable($cFunc)) {
                    $this->mapFuncs[$cName] = $cFunc;
                }

            }
        }

    }
245317
function isRunning(pid, callback) {
    if (!pid) {
        return callback(false);
    }

    cp.exec(util.format(process.platform === 'win32' ?
        'tasklist /fi "PID eq %s" | findstr /i "node.exe"'
        : 'ps -f -p %s | grep "node"', pid),
        function (err, stdout, stderr) {
            callback(!err && !!stdout.toString().trim());
        });
}
688563
def on_startup(self, callback: callable, polling=True, webhook=True):
        
        self._check_frozen()
        if not webhook and not polling:
            warn('This action has no effect!', UserWarning)
            return

        if isinstance(callback, (list, tuple, set)):
            for cb in callback:
                self.on_startup(cb, polling, webhook)
            return

        if polling:
            self._on_startup_polling.append(callback)
        if webhook:
            self._on_startup_webhook.append(callback)
702468
function() {
		var i = 0;
		while (i<_callbacks.length) {
			var deps = _callbacks[i][0],
				func = _callbacks[i][1],
				n = 0;
			while (n<deps.length) {
				if (areDeepDepsDefined(deps[n])) {
					deps.splice(n, 1);
				}
				else {
					n++;
				}
			}
			if (!deps.length) {
				_callbacks.splice(i, 1);
				if (func != null) {
					setTimeout(func, 0);
				}
			}
			else {
				i++;
			}
		}
	}
1110780
function exec (cmd, callback) {
  debug('executing cmd', cmd)
  child_process.exec(cmd, function (err, stdout, stderr) {
    debug('command completed')
    if (err) {
      if (callback) {
        callback(err)
      }
    } else {
      if (callback) {
        callback(null, stdout, stderr)
      }
    }
  })
}
1053859
public void serverCallStarted(ServerCallInfo<?, ?> callInfo) {
    for (StreamTracer tracer : tracers) {
      ((ServerStreamTracer) tracer).serverCallStarted(callInfo);
    }
  }
53457
function callbackOnce(err, arg) {
            var cb = callback;
            callback = null;
            if (cb) { cb(err, arg); }
        }
1121719
public void script(String line, DispatchCallback callback) {
    if (sqlLine.getScriptOutputFile() == null) {
      startScript(line, callback);
    } else {
      stopScript(line, callback);
    }
  }
564438
def _run_callbacks(self):
        """"""
        for i in range(len(self._callbacks)):
            callback, args = self._callbacks.popleft()
            try:
                callback(*args)
            except Exception:
                self._log.exception('Ignoring exception in callback:')
48594
function onInit(unused, callback) {
    var filePath = path.resolve(options.file);

    stats.deserialise.fs.start = Date.now();
    if (fs.existsSync(filePath)) {
      fs.readFile(filePath, complete);
    } else {
      complete(true);
    }

    function complete(error, contents) {
      stats.deserialise.fs.stop = Date.now();

      stats.deserialise.decode.start = Date.now();
      pending = !error && contents && cycle.retrocycle(decode(JSON.parse(contents)));
      stats.deserialise.decode.stop = Date.now();

      stats.deserialise.success = !error;
      callback();
    }
  }
493967
function call(handle) {
          handle.callback.apply(handle.context, args);
          called = true;
        }
394752
function onApplicationStart(callback) {
    if (typeof Ember === 'undefined') {
      return;
    }

    const adapterInstance = requireModule('ember-debug/adapters/' + currentAdapter)['default'].create();

    adapterInstance.onMessageReceived(function(message) {
      if (message.type === 'app-picker-loaded') {
        sendApps(adapterInstance, getApplications());
      }

      if (message.type === 'app-selected') {
        const appInstance = getApplications().find(app => Ember.guidFor(app) === message.applicationId);

        if (appInstance && appInstance.__deprecatedInstance__) {
          bootEmberInspector(appInstance.__deprecatedInstance__);
        }
      }
    });

    var apps = getApplications();

    sendApps(adapterInstance, apps);

    var app;
    for (var i = 0, l = apps.length; i < l; i++) {
      app = apps[i];
      // We check for the existance of an application instance because
      // in Ember > 3 tests don't destroy the app when they're done but the app has no booted instances.
      if (app._readinessDeferrals === 0) {
        let instance = app.__deprecatedInstance__ || (app._applicationInstances && app._applicationInstances[0]);
        if (instance) {
          // App started
          setupInstanceInitializer(app, callback);
          callback(instance);
          break;
        }
      }
    }
    Ember.Application.initializer({
      name: 'ember-inspector-booted',
      initialize: function(app) {
        setupInstanceInitializer(app, callback);
      }
    });
  }
168852
private void initialize(Handler callbackHandler) {
		int processors = Runtime.getRuntime().availableProcessors();
		mDownloadDispatchers = new DownloadDispatcher[processors];
		mDelivery = new CallBackDelivery(callbackHandler);
	}
768099
def _start_callbacks(self, result, exception):
        
        if self._cancelled:
            raise CancelledError()
        if self.called:
            raise AlreadyCalledError()

        self._result = result
        self._exception = exception
        if self._exception:
            self._tb_info = ''.join(traceback.format_tb(sys.exc_info()[2])) 
        self.called = True
        self._do_callbacks()
997153
function callback (start, end, props) {
        if (props === undefined) {
            props = {};
        }
        key = blockKey + KEY_SEPARATOR + decorationId;
        decorated[blockKey][decorationId] = props;
        decorateRange(decorations, start, end, key);
        decorationId++;
    }
837151
def output_callback(self, line, kill_switch):
        """"""
        self.notifications += line + "\n"

        if "Initialization Sequence Completed" in line:
            self.started = True
        if "ERROR:" in line or "Cannot resolve host address:" in line:
            self.error = True
        if "process exiting" in line:
            self.stopped = True