Receive the given $signal and react on it.

@param \eZ\Publish\Core\SignalSlot\Signal $signal
552268
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\ObjectStateService\DeleteObjectStateSignal) {
            return;
        }

        parent::receive($signal);
    }
403297
protected function signal($pid, $signal)
    {
        if (function_exists('posix_kill')) {
            return posix_kill($pid, $signal);
        } else {
            system("kill -$signal $pid", $result);
            return $result === 0;
        }
    }
772204
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\LocationService\UnhideLocationSignal) {
            return;
        }

        $this->indexSubtree($signal->locationId);
    }
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
            }
        );
    }
96017
public function stop($signal = null)
    {
        if (!$this->running) {
            return;
        }

        if (null !== $signal) {
            $this->getLogger()->info('Stop called because of signal #'.$signal.'. Current state: '.$this->worker->getState().'.');
        } else {
            $this->getLogger()->info('Stop called: '.$this->worker->getState().'.');
        }

        $this->running = false;
        $this->worker->shutdown();
    }
583521
protected function sendSignal($signal)
    {
        try {
            $this->process->signal($signal);
        } catch (ExceptionInterface $e) {
            if ($this->process->isRunning()) {
                throw $e;
            }
        }
    }
729205
public function dispatchSignal($signal)
    {
        if (isset($this->handlers[$signal])) {
            foreach ($this->handlers[$signal] as $namespaceHandlers) {
                foreach ($namespaceHandlers as $handler) {
                    $handler();
                }
            }
        }

        return $this;
    }
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));
    }
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));
    }
1314302
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\UserService\CreateUserSignal) {
            return;
        }

        $userContentInfo = $this->persistenceHandler->contentHandler()->loadContentInfo(
            $signal->userId
        );

        $this->searchHandler->indexContent(
            $this->persistenceHandler->contentHandler()->load(
                $userContentInfo->id,
                $userContentInfo->currentVersionNo
            )
        );

        $locations = $this->persistenceHandler->locationHandler()->loadLocationsByContent(
            $userContentInfo->id
        );
        foreach ($locations as $location) {
            $this->searchHandler->indexLocation($location);
        }
    }
707744
public function addSignal($signal, $callback)
    {
        $event = \Event::signal($this->_eventBase, $signal, $callback);
        if (!$event||!$event->add()) {
            return false;
        }
        $this->_signalEvents[$signal] = $event;
    }
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();
        }
    }
1325163
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\UserService\CreateUserGroupSignal) {
            return;
        }

        $userGroupContentInfo = $this->persistenceHandler->contentHandler()->loadContentInfo(
            $signal->userGroupId
        );

        $this->searchHandler->indexContent(
            $this->persistenceHandler->contentHandler()->load(
                $userGroupContentInfo->id,
                $userGroupContentInfo->currentVersionNo
            )
        );

        $locations = $this->persistenceHandler->locationHandler()->loadLocationsByContent(
            $userGroupContentInfo->id
        );
        foreach ($locations as $location) {
            $this->searchHandler->indexLocation($location);
        }
    }
1077530
public function handle($signal, $handler, $namespace = self::DEFAULT_NAMESPACE)
    {
        if (empty($this->handlers[$signal])) {
            $this->handlers[$signal] = [];
        }

        if (empty($this->handlers[$signal][$namespace])) {
            $this->handlers[$signal][$namespace] = [];
        }

        $this->handlers[$signal][$namespace][] = $handler;

        return $this;
    }
889907
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\UserService\DeleteUserGroupSignal) {
            return;
        }

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

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

        $this->client->updateContent($signal->contentId);
    }
1106210
public function broadcast($signal) {
        if ($signal == SIGINT || $signal == SIGKILL) {
            $this->isStopped = true;
        }
        foreach ($this->handlers as $handler) {
            posix_kill($handler, $signal);
        }
    }