Emits ready if it has not been emitted already.

@return void
162928
protected function ready()
    {
        if ($this->emittedReady) {
            return false;
        }

        $this->logger->info('client is ready');
        $this->emit('ready', [$this]);

        foreach ($this->unparsedPackets as $parser) {
            $parser();
        }
    }
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;
		}
	}
931851
public function onReady()
    {
        $this->redis = \PHPDaemon\Clients\Redis\Pool::getInstance($this->config->redisname->value);
        $this->sessions = new ObjectStorage;
        $this->wss = new ObjectStorage;
        foreach (preg_split('~\s*;\s*~', $this->config->wssname->value) as $wssname) {
            $this->attachWss(WebSocketPool::getInstance(trim($wssname)));
        }
    }
1346056
public function onBeforeInit() {
        $only_dev = LessCompilerConfig::config()->only_dev;
        
        // Only check and compile either on dev, or on all environments (if set)
        if (!$only_dev || $only_dev && Director::isDev()) {

            // Allow extensions for before less is compiled
            $this->owner->extend("onBeforeLessCompiler");

            $files = LessCompilerConfig::config()->file_mappings;
            $root_path = LessCompilerConfig::config()->root_path;
            $temp_folder = TEMP_FOLDER;
            
            if (is_array($files)) {
                $theme_dir = Controller::join_links(
                    "themes",
                    SSViewer::current_theme()
                );
                $base_theme = Controller::join_links(
                    $theme_dir,
                    SSViewer::current_theme()
                );
                
                $options = array('cache_dir' => $temp_folder);
                
                if (LessCompilerConfig::config()->compress) {
                    $options['compress'] = true;
                }
                
                // First loop through all files and deal with inputs
                foreach ($files as $input => $output) {
                    if ($input && $output) {
                        
                        // Does output and input contain a path
                        if (strpos($input, '/') === false) {
                            $input = Controller::join_links(
                                $theme_dir,
                                "less",
                                $input
                            );
                        }
                        
                        if (strpos($output, '/') === false) {
                            $output = Controller::join_links(
                                $theme_dir,
                                "css",
                                $output
                            );
                        }
                        
                        // Now append the full system path to the input
                        // and output file.
                        $input = Controller::join_links(BASE_PATH, $input);
                        $output = Controller::join_links(BASE_PATH, $output);
                        
                        // Finally try to compile our less files
                        try {
                            $css_file_name = Less_Cache::Get(
                                array( $input => $root_path),
                                $options
                            );
                            $css = file_get_contents(Controller::join_links($temp_folder,$css_file_name));
                            
                            $output_file = fopen($output, "w");
                            fwrite($output_file, $css);
                            fclose($output_file);
                        } catch (exception $e) {
                            error_log($e->getMessage());
                        }
                    }
                }
            }

            // Allow extensions for after less has compiled
            $this->owner->extend("onAfterLessCompiler");
        }
    }
567440
public function listen()
    {
        if (defined('LARAVEL_START')) {
            $this->start(static::REQUEST_TIMER, LARAVEL_START);
        }

        $this->dispatcher->listen(StartProfiling::class, function (StartProfiling $event) {
            $this->start($event->name);
        });

        $this->dispatcher->listen(StopProfiling::class, function (StopProfiling $event) {
            $this->stop($event->name);
        });
    }
1203092
public function run(): void
    {
        $request = $this->kernel->getRequest();

        $response = $this->handle($request);

        $this->emit($response);
    }
1262218
public function callInitialize()
    {
        foreach ($this->pluginCollection as $plugin) {
            $subscriber = new EventSubscriber();
            $plugin->initialize($subscriber);

            $this->eventSubscriberPlugins[] = [$plugin, $subscriber];

            $this->addListeners($plugin, $subscriber);
        }
    }
729482
protected function emitPackageStatesUpdated()
    {
        if ($this->bootstrap === null) {
            return;
        }

        if ($this->dispatcher === null) {
            $this->dispatcher = $this->bootstrap->getEarlyInstance(Dispatcher::class);
        }

        $this->dispatcher->dispatch(PackageManager::class, 'packageStatesUpdated');
    }
821575
public function onWakeup()
    {
        $this->running = true;
        Daemon::$req = $this;
        Daemon::$context = $this;
        Daemon::$process->setState(Daemon::WSTATE_BUSY);
    }
303346
public function onReady()
    {
        \PHPDaemon\Servers\WebSocket\Pool::getInstance()->addRoute(
            '/sockjs',
            function ($client) {
                return new SimpleRoute($client, $this);
            }
        );
    }
1250495
public function executed()
    {
        $this->setLastRun(new \DateTime());
        if (!$this->getModify()) {
            $this->setStatus(self::STATUS_DISABLED);
        }
        if ($this->getStatus() == self::STATUS_ENABLED) {
            // find near time task launch
            $next_run = $this->getNextRun();
            do {
                // failed to compute time of next run
                if ($next_run->modify($this->getModify()) === false) {
                    $this->setModify('');
                    $this->setStatus(self::STATUS_DISABLED);
                    break;
                }
            } while ($next_run->getTimestamp() <= time());
            $this->setNextRun($next_run);
        }
    }
578666
public function onInit()
    {
        $this->nameSort = Utility::get($this->params, '{name}', null);
        $this->labelSort = Utility::get($this->params, '{label}', null);
        $this->fixedColumns = Utility::get($this->params, 'fixedColumns', null);
    }
1254325
public function onReady()
    {
        $this->ptr =& $this->result;
        if (!isset($this->password)) {
            if (isset($this->pool->config->select->value)) {
                $this->select($this->pool->config->select->value);
            }
            parent::onReady();
            $this->setWatermark(null, $this->pool->maxAllowedPacket + 2);
            return;
        }
        $this->sendCommand('AUTH', [$this->password], function () {
            if ($this->result !== 'OK') {
                $this->log('Auth. error: ' . json_encode($this->result));
                $this->finish();
            }
            if (isset($this->pool->config->select->value)) {
                $this->select($this->pool->config->select->value);
            }
            parent::onReady();
            $this->setWatermark(null, $this->pool->maxAllowedPacket + 2);
        });
    }
1366634
public function onBeforeWrite()
    {
        $this->owner->StyleID = $this->owner->cleanStyleID($this->owner->StyleID);
        $this->owner->StyleClasses = $this->owner->cleanStyleClasses($this->owner->StyleClasses);
    }
426238
public function onReady()
    {
        $this->createXMLStream();
        $this->startXMLStream();
        $this->keepaliveTimer = setTimeout(function ($timer) {
            $this->ping();
        }, 1e6 * 30);
    }
625322
protected function initialize()
    {
        if ($this->initialized === true) {
            return;
        }
        $this->initialized = true;
        $this->buildFullConfiguration();
        $this->applyPostprocessing();
    }
861833
private function doBeforeCompile(): void
	{
		$builder = $this->getContainerBuilder();
		$dispatcher = $builder->getDefinition($this->prefix('dispatcher'));

		$subscribers = $builder->findByType(EventSubscriberInterface::class);
		foreach ($subscribers as $name => $subscriber) {
			$dispatcher->addSetup('addSubscriber', [$subscriber]);
		}
	}