vendor/pimcore/pimcore/bundles/CoreBundle/EventListener/MessengerClearRuntimeCacheListener.php line 39

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4.  * Pimcore
  5.  *
  6.  * This source file is available under two different licenses:
  7.  * - GNU General Public License version 3 (GPLv3)
  8.  * - Pimcore Commercial License (PCL)
  9.  * Full copyright and license information is available in
  10.  * LICENSE.md which is distributed with this source code.
  11.  *
  12.  *  @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  13.  *  @license    http://www.pimcore.org/license     GPLv3 and PCL
  14.  */
  15. namespace Pimcore\Bundle\CoreBundle\EventListener;
  16. use Pimcore\Cache\Runtime;
  17. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  18. use Symfony\Component\Messenger\Event\WorkerMessageReceivedEvent;
  19. /**
  20.  * @internal
  21.  */
  22. class MessengerClearRuntimeCacheListener implements EventSubscriberInterface
  23. {
  24.     /**
  25.      * {@inheritdoc}
  26.      */
  27.     public static function getSubscribedEvents()
  28.     {
  29.         return [
  30.             WorkerMessageReceivedEvent::class => 'handle',
  31.         ];
  32.     }
  33.     public function handle(WorkerMessageReceivedEvent $event)
  34.     {
  35.         Runtime::clear();
  36.     }
  37. }