triger the server_ready event
162337
def connected(self, **kwargs):
        """"""
        self.bot.log.info('Server config: %r', self.bot.server_config)

        # recompile when I'm sure of my nickname
        self.bot.config['nick'] = kwargs['me']
        self.bot.recompile()

        # Let all plugins know that server can handle commands
        self.bot.notify('server_ready')

        # detach useless events
        self.bot.detach_events(*self.before_connect_events)
954858
function onPrepare() {
    if (IS_JSON_FORMAT) {
        return browser.getCapabilities()
            .then((capabilities) => {
                PID_INSTANCE_DATA.metadata.browser.name = PID_INSTANCE_DATA.metadata.browser.name === ''
                    ? capabilities.get('browserName').toLowerCase()
                    : PID_INSTANCE_DATA.metadata.browser.name;
                PID_INSTANCE_DATA.metadata.browser.version = (capabilities.get('version') || capabilities.get('browserVersion'))
                    || PID_INSTANCE_DATA.metadata.browser.version;
            });
    }
}
673406
def trigger(self, event, *args):
        """"""
        for handler in self._event_handlers[event]:
            handler(*args)
362050
function ready(callback) {
  let onLoaded = (event) => {
    if (document.addEventListener) {
      document.removeEventListener('DOMContentLoaded', onLoaded, false);
      window.removeEventListener('load', onLoaded, false);
    }
    else if (document.attachEvent) {
      document.detachEvent('onreadystatechange', onLoaded);
      window.detachEvent('onload', onLoaded);
    }

    setTimeout(callback, 1);
  };

  if (document.readyState === 'complete') return setTimeout(callback, 1);

  if (document.addEventListener) {
    document.addEventListener('DOMContentLoaded', onLoaded, false);
    window.addEventListener('load', onLoaded, false);
  }
  else if (document.attachEvent) {
    document.attachEvent('onreadystatechange', onLoaded);
    window.attachEvent('onload', onLoaded);
  }
}
551278
def set_server_callback(self, handle):
        
        if self.on_events:
            for event in self.on_events:
                handle.on_event(event, self.on_event)
        if self.on_changes:
            for change in self.on_changes:
                if change in ['patching', 'streaming']:
                    # Patch and stream events do not need handling on server
                    continue
                handle.on_change(change, self.on_change)
1318685
function() {

        if (asyncLogging) {
          if (workerId > 0) {
            Utility.asyncStepLogger(workerId + "\t Registering Server");
          } else {
            Utility.asyncStepLogger("Registering Server");
          }
        }

        var content = {
          name: serverName
        };

        pushSendData({
          type: asyncMessageType.SERVER_REGISTER,
          content: content
        });

        registerServerTimeoutId = setTimeout(function() {
          if (!isServerRegister) {
            registerServer();
          }
        }, connectionRetryInterval);
      }
993715
@Override
  public void contextInitialized(ServletContextEvent event) {
    this.event = event;
    this.serverContainer = getServerContainer(event);
    super.contextInitialized(event);
  }
213259
def serve(self):
        """"""
        while self.ready:
            try:
                self.tick()
            except (KeyboardInterrupt, SystemExit):
                raise
            except Exception:
                self.error_log(
                    'Error in HTTPServer.tick', level=logging.ERROR,
                    traceback=True,
                )

            if self.interrupt:
                while self.interrupt is True:
                    # Wait for self.stop() to complete. See _set_interrupt.
                    time.sleep(0.1)
                if self.interrupt:
                    raise self.interrupt
1024084
function ready() {
            if (!readyFired) {
                // this must be set to true before we start calling callbacks
                readyFired = true;
                for (var i = 0; i < readyList.length; i++) {
                    // if a callback here happens to add new ready handlers,
                    // the docReady() function will see that it already fired
                    // and will schedule the callback to run right after
                    // this event loop finishes so all handlers will still execute
                    // in order and no new ones will be added to the readyList
                    // while we are processing the list
                    readyList[i].fn.call(window, readyList[i].ctx);
                }
                // allow any closures held by these functions to free
                readyList = [];
            }
        }
1243721
async def wait_closed(self):
        
        if self._server is None:
            raise RuntimeError('Server is not started')
        await self._server.wait_closed()
        if self._handlers:
            await asyncio.wait({h.wait_closed() for h in self._handlers},
                               loop=self._loop)
1169973
function OpenEventObserver(clientPort, serverPort) {
    events.EventEmitter.call(this);

    this.isClientPortOpen = false;
    this.isServerPortOpen = false;

    clientPort.on('open', this._clientPortOpenHandler(this));
    serverPort.on('open', this._serverPortOpenHandler(this));
}
12706
protected int subscribe_data_ready_event(String attr_name, String[] filters, boolean stateless)
            throws DevFailed {
        return event_supplier.subscribe_event(attr_name,
                DATA_READY_EVENT, this, filters, stateless);
    }
234640
protected void startServerCommandListener() {
        String uuid = systemBundleCtx.getProperty("org.osgi.framework.uuid");
        sc = new ServerCommandListener(config, uuid, this);
        sc.startListening();
    }
971339
def process_event(self, event, client, args, force_dispatch=False):
        
        if not self.running:
            _log.debug("Ignoring '%s' event - controller not running.", event)
            return

        # We keep a copy of the state of loaded modules before this event,
        # and restore it when we're done. This lets us handle events that
        # result in other events being dispatched in a graceful manner.
        old_loaded = self.loaded_on_this_event
        self.loaded_on_this_event = set(old_loaded or []) if not force_dispatch else set()

        try:
            _log.debug("Controller is dispatching '%s' event", event)
            for module_name in self.module_ordering:
                if module_name in self.loaded_on_this_event and not force_dispatch:
                    _log.debug("Not dispatching %s to '%s' because it was just "
                               "loaded (%r).", event, module_name,
                               self.loaded_on_this_event)
                    continue
                module = self.loaded_modules[module_name]
                if module.handle_event(event, client, args):
                    return True
        finally:
            self.loaded_on_this_event = old_loaded
684163
def listen_init(self):
        """"""
        self.dispatcher = ObjectDispatch(self)
        self.factory = MsgPackProtocolFactory(self.dispatcher)
        self.server = UnixServer(self.loop, self.factory, self.path)
        self.server.start()
475382
function onReadyStateChange(req, scriptTag) {
		if (scriptTag && scriptTag.readyState != 'loaded') { return; }
		scriptTag.onreadystatechange = function() {};
		checkForError.call(this, req);
	}
563981
def waitStarted(self):
        """"""
        ns = None
        while not ns:
            try:
                time.sleep(3)
                ns = Pyro.naming.NameServerLocator(
                    identification=self.identification).getNS()
            except Pyro.errors.NamingError as er:
                pass