Receive the given $signal and react on it.

@param Signal $signal
547594
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\ContentService\UpdateContentMetadataSignal) {
            return;
        }

        $contentInfo = $this->persistenceHandler->contentHandler()->loadContentInfo($signal->contentId);
        if (!$contentInfo->isPublished) {
            return;
        }
        $this->searchHandler->indexContent(
            $this->persistenceHandler->contentHandler()->load($contentInfo->id, $contentInfo->currentVersionNo)
        );
        $this->searchHandler->indexLocation($this->persistenceHandler->locationHandler()->load($contentInfo->mainLocationId));
    }
249387
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\LocationService\SwapLocationSignal) {
            return;
        }

        $this->runLegacyKernelCallback(
            static function () use ($signal) {
                eZContentCacheManager::clearContentCacheIfNeeded($signal->content1Id);
                eZContentCacheManager::clearContentCacheIfNeeded($signal->content2Id);
                eZSearch::swapNode($signal->location1Id, $signal->location2Id);
                eZContentObject::clearCache(); // Clear all object memory cache to free memory
            }
        );
    }
1364423
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\UserService\CreateUserSignal) {
            return;
        }

        $this->runLegacyKernelCallback(
            static function () use ($signal) {
                eZContentCacheManager::clearContentCacheIfNeeded($signal->userId);
                eZContentOperationCollection::registerSearchObject($signal->userId);
                eZContentObject::clearCache(); // Clear all object memory cache to free memory
            }
        );
    }
73733
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\ContentService\DeleteContentSignal) {
            return;
        }

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

        // Delete locations if there is any
        foreach ($signal->affectedLocationIds as $locationId) {
            $this->searchHandler->deleteLocation($locationId, $signal->contentId);
        }
    }
341306
public function workerSignal(int $signal) {
        $this->log(LogLevel::DEBUG, "[{pid}] Caught signal '{$signal}' (SIGHUP) at worker - handing off to payload handler");

        switch ($signal) {

            // Daemon was asked to hang up
            case SIGHUP:
                $this->payloadExec('signal', [$signal]);
                break;

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

            // Custom signal - Nothing
            case SIGUSR2:
                $this->payloadExec('signal', [$signal]);
                break;
        }
    }
109529
public static function Send($signal_type, \Peg\Lib\Signals\SignalData &$signal_data = null)
    {
        if(!isset(self::$listeners[$signal_type]))
            return;

        foreach(self::$listeners[$signal_type] as $callback_data)
        {
            $callback = $callback_data['callback'];

            if(is_object($signal_data))
                $callback($signal_data);
            else
                $callback();
        }
    }
671262
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\ContentService\RevealContentSignal) {
            return;
        }

        $locations = $this->persistenceHandler->locationHandler()->loadLocationsByContent($signal->contentId);
        foreach ($locations as $location) {
            $this->indexSubtree($location->id);
        }
    }
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
            }
        );
    }
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;
        }
    }
929118
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\LocationService\MoveSubtreeSignal) {
            return;
        }

        $this->runLegacyKernelCallback(
            static function () use ($signal) {
                $node = eZContentObjectTreeNode::fetch($signal->locationId);
                eZContentObjectTreeNode::clearViewCacheForSubtree($node);
                eZContentOperationCollection::registerSearchObject($node->attribute('contentobject_id'));
                eZContentObject::clearCache(); // Clear all object memory cache to free memory
            }
        );
    }
152729
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\ContentTypeService\PublishContentTypeDraftSignal) {
            return;
        }

        $this->runLegacyKernelCallback(
            static function () use ($signal) {
                eZExpiryHandler::registerShutdownFunction();
                $handler = eZExpiryHandler::instance();
                $time = time();
                $handler->setTimestamp('user-class-cache', $time);
                $handler->setTimestamp('class-identifier-cache', $time);
                $handler->setTimestamp('sort-key-cache', $time);
                $handler->store();
            }
        );
    }
720901
public function signalReceived($signal)
	{
		if (!$this->tryCall($this->formatSignalMethod($signal), $this->params)) {
			$class = get_class($this);
			throw new BadSignalException("There is no handler for signal '$signal' in class $class.");
		}
	}
1374983
public function shutdown($signal = SIGTERM)
    {
        foreach ($this->processes as $process) {
            if ($process->isRunning()) {
                $process->shutdown(true, $signal);
            }
        }
    }
404966
public function emit($signal, $params = null)
  {
    if(!$this->hasHandlers($signal))
    {
      return;
    }

    if(!is_array($params))
    {
      $params = func_get_args();
      $params = array_slice($params, 1);
    }

    foreach($this->sigslots[$signal] as $slot)
    {
      $return = $slot->call($params);
    }

    return $return;
  }
1020897
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\ContentService\DeleteVersionSignal) {
            return;
        }

        $this->runLegacyKernelCallback(
            static function () use ($signal) {
                eZContentCacheManager::clearContentCacheIfNeeded($signal->contentId);
                eZSearch::removeObjectById($signal->contentId, null);
                eZContentOperationCollection::registerSearchObject($signal->contentId);
                eZContentObject::clearCache(); // Clear all object memory cache to free memory
            }
        );
    }
583521
protected function sendSignal($signal)
    {
        try {
            $this->process->signal($signal);
        } catch (ExceptionInterface $e) {
            if ($this->process->isRunning()) {
                throw $e;
            }
        }
    }
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;
        }
    }