You are here

protected function HtmlResponseBigPipeSessionlessSubscriber::getBigPipeService in Sessionless BigPipe 2.x

Same name and namespace in other branches
  1. 8 src/EventSubscriber/HtmlResponseBigPipeSessionlessSubscriber.php \Drupal\big_pipe_sessionless\EventSubscriber\HtmlResponseBigPipeSessionlessSubscriber::getBigPipeService()

Returns the BigPipe service to use to send the current response.

Parameters

\Symfony\Component\HttpKernel\Event\ResponseEvent $event: A response event.

Return value

\Drupal\big_pipe\Render\BigPipe The BigPipe service.

Overrides HtmlResponseBigPipeSubscriber::getBigPipeService

File

src/EventSubscriber/HtmlResponseBigPipeSessionlessSubscriber.php, line 55

Class

HtmlResponseBigPipeSessionlessSubscriber
Response subscriber to replace the HtmlResponse with a BigPipeResponse.

Namespace

Drupal\big_pipe_sessionless\EventSubscriber

Code

protected function getBigPipeService(ResponseEvent $event) {

  // Returns the BigPipeSessionless service for sessionless requests.
  return $this->sessionConfiguration
    ->hasSession($event
    ->getRequest()) ? $this->bigPipe : $this->bigPipeSessionless;
}