You are here

public static function HtmlResponseBigPipeSubscriber::getSubscribedEvents in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/big_pipe/src/EventSubscriber/HtmlResponseBigPipeSubscriber.php \Drupal\big_pipe\EventSubscriber\HtmlResponseBigPipeSubscriber::getSubscribedEvents()
  2. 10 core/modules/big_pipe/src/EventSubscriber/HtmlResponseBigPipeSubscriber.php \Drupal\big_pipe\EventSubscriber\HtmlResponseBigPipeSubscriber::getSubscribedEvents()

File

core/modules/big_pipe/src/EventSubscriber/HtmlResponseBigPipeSubscriber.php, line 115

Class

HtmlResponseBigPipeSubscriber
Response subscriber to replace the HtmlResponse with a BigPipeResponse.

Namespace

Drupal\big_pipe\EventSubscriber

Code

public static function getSubscribedEvents() {

  // Run after HtmlResponsePlaceholderStrategySubscriber (priority 5), i.e.
  // after BigPipeStrategy has been applied, but before normal (priority 0)
  // response subscribers have been applied, because by then it'll be too late
  // to transform it into a BigPipeResponse.
  $events[KernelEvents::RESPONSE][] = [
    'onRespondEarly',
    3,
  ];

  // Run as the last possible subscriber.
  $events[KernelEvents::RESPONSE][] = [
    'onRespond',
    -10000,
  ];
  return $events;
}