function HtmlResponseBigPipeSubscriber::getSubscribedEvents

Same name in other branches
  1. 8.9.x 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()
  3. 11.x 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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.