Receive the given $signal and react on it.

@param \eZ\Publish\Core\SignalSlot\Signal $signal
776670
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\UserService\UnAssignUserFromUserGroupSignal) {
            return;
        }

        $this->runLegacyKernelCallback(
            static function () {
                eZContentCacheManager::clearAllContentCache();
                eZRole::expireCache();
            }
        );
    }
421489
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\ContentService\CopyContentSignal) {
            return;
        }

        $this->searchHandler->indexContent(
            $this->persistenceHandler->contentHandler()->load(
                $signal->dstContentId,
                $signal->dstVersionNo
            )
        );

        $locations = $this->persistenceHandler->locationHandler()->loadLocationsByContent(
            $signal->dstContentId
        );
        foreach ($locations as $location) {
            $this->searchHandler->indexLocation($location);
        }
    }
672890
public function emit(Signal $signal)
    {
        $signalName = get_class($signal);
        if (!isset($this->signalSlotMap[$signalName])) {
            $this->signalSlotMap[$signalName] = array();
        }

        foreach (array_merge($this->signalSlotMap['*'], $this->signalSlotMap[$signalName]) as $slot) {
            /* @var \eZ\Publish\Core\SignalSlot\Slot $slot */
            $slot->receive($signal);
        }
    }
1018178
public void signal(Signal signal, CmsUUID id) {

        getStatus(id).handleSignal(signal);
        runSelectionChangeAction();
    }
349135
public function handleSignal(int $signal) {
        $this->log(LogLevel::DEBUG, "[{pid}] Caught signal '{$signal}'");

        switch ($signal) {

            // Daemon was asked to hang up
            case SIGHUP:
                if ($this->realm == 'daemon') {
                    $handled = $this->payloadExec('signal', [$signal]);
                    if (!$handled) {
                        throw new Exception("Restart", 100);
                    }
                }
                break;

            // Daemon is exiting, kill children
            case SIGINT:
            case SIGTERM:
                if ($this->realm == 'daemon') {
                    if ($this->instance) {
                        if (is_callable([$this->instance, 'shutdown'])) {
                            $this->instance->shutdown();
                        }
                    }
                    $this->reapAllChildren();
                    $this->payloadExec('signal', [$signal]);
                    throw new Exception("Shutdown", 200);
                }
                break;

            // Child process exited
            case SIGCHLD:
                if ($this->realm == 'daemon') {
                    do {
                        $status = null;
                        $pid = pcntl_wait($status, WNOHANG);
                        if ($pid > 0) {
                            $this->reapChild($pid, $status);
                        }
                    } while ($pid > 0);

                    //$pid = pcntl_waitpid(-1, $status, WNOHANG);
                    //if ($pid > 0)
                    //   $this->land($pid, $status);
                }
                break;

            // Custom signal - Nothing
            case SIGUSR1:
                $this->payloadExec('signal', [$signal]);
                break;

            // Custom signal - Nothing
            case SIGUSR2:
                $this->payloadExec('signal', [$signal]);
                break;
        }
    }
795824
public function emit(Signal $signal)
    {
        if ($this->transactionDepth === 0) {
            $this->signalDispatcher->emit($signal);
        } else {
            $this->signalsQueue[$this->transactionCount][] = $signal;
        }
    }
707893
public static function signalHandler($signal)
    {
        switch ($signal) {
            // Stop.
            case SIGINT:
                self::stopAll();
                break;
            // Reload.
            case SIGUSR1:
                self::$_pidsToRestart = self::getAllWorkerPids();
                self::reload();
                break;
            // Show status.
            case SIGUSR2:
                self::writeStatisticsToStatusFile();
                break;
        }
    }
1269859
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\ObjectStateService\UpdateObjectStateSignal) {
            return;
        }

        parent::receive($signal);
    }
552268
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\ObjectStateService\DeleteObjectStateSignal) {
            return;
        }

        parent::receive($signal);
    }
620195
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\LanguageService\DisableLanguageSignal) {
            return;
        }

        $this->runLegacyKernelCallback(
            static function () {
                eZContentLanguage::expireCache();
            }
        );
    }
1354196
public static function signal($signals, $callback)
    {
        foreach ($signals as $signal) {
            if (is_null($callback)) {
                \Swoole\Process::signal($signal, null);
                continue;
            }
            \Swoole\Process::signal($signal, function ($signal) use ($callback) {
                try {
                    call_user_func($callback, $signal);
                } catch (\Throwable $e) {
                    \Mix::$app->error->handleException($e);
                }
            });
        }
    }
869502
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\UserService\DeleteUserSignal) {
            return;
        }

        // Delete Content
        $this->searchHandler->deleteContent($signal->userId);

        // Delete locations if there is any
        foreach ($signal->affectedLocationIds as $locationId) {
            $this->searchHandler->deleteLocation($locationId, $signal->userId);
        }
    }
1204842
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\ObjectStateService\SetContentStateSignal) {
            return;
        }

        $this->runLegacyKernelCallback(
            static function () use ($signal) {
                eZContentCacheManager::clearContentCacheIfNeeded($signal->contentId);
                eZSearch::updateObjectState($signal->contentId, [$signal->objectStateId]);
                eZContentObject::clearCache(); // Clear all object memory cache to free memory
            }
        );
    }
245487
public function executeListener($signal, $exit = true)
    {
        $return = null;

        if (isset($this->listeners[$signal])) {
            $return = call_user_func_array($this->listeners[$signal], [$signal]);
        }

        if (true === $exit) {
            // exit the application
            posix_kill(posix_getpid(), SIGKILL);
        }

        return $return;
    }
232673
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\LocationService\CreateLocationSignal) {
            return;
        }

        $this->runLegacyKernelCallback(
            static function () use ($signal) {
                eZContentCacheManager::clearContentCacheIfNeeded($signal->contentId, true, [$signal->locationId]);
                $object = eZContentObject::fetch($signal->contentId);
                eZSearch::addNodeAssignment($object->mainNodeID(), $signal->contentId, $signal->locationId);
                eZContentObject::clearCache(); // Clear all object memory cache to free memory
            }
        );
    }
686916
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\LocationService\SwapLocationSignal) {
            return;
        }

        $contentInfoList = $this->persistenceHandler->contentHandler()->loadContentInfoList([$signal->content1Id, $signal->content2Id]);
        $this->searchHandler->indexContent(
            $this->persistenceHandler->contentHandler()->load(
                $signal->content1Id,
                $contentInfoList[$signal->content1Id]->currentVersionNo
            )
        );
        $this->searchHandler->indexContent(
            $this->persistenceHandler->contentHandler()->load(
                $signal->content2Id,
                $contentInfoList[$signal->content2Id]->currentVersionNo
            )
        );
        $this->searchHandler->indexLocation($this->persistenceHandler->locationHandler()->load($signal->location1Id));
        $this->searchHandler->indexLocation($this->persistenceHandler->locationHandler()->load($signal->location2Id));
    }
787779
public function signalHandler($signal)
    {
        $this->emit('signal', $signal);
        $this->emit($signal);

        // Default signal process
        if ($this->options['catch_signal']) {
            $this->signalHandlerDefault($signal);
        }
    }