class BigPipeResponse extends HtmlResponse (View source)

internal  This is a temporary solution until a generic response emitter interface is created in https://www.drupal.org/node/2577631. Only code internal to BigPipe should instantiate or type hint to this class.
 

A response that is sent in chunks by the BigPipe service.

Note we cannot use \Symfony\Component\HttpFoundation\StreamedResponse because it makes the content inaccessible (hidden behind a callback), which means no middlewares are able to modify the content anymore.

Traits

Provides an implementation of CacheableResponseInterface.

Provides an implementation of AttachmentsInterface.

Properties

protected CacheableMetadata $cacheabilityMetadata

The cacheability metadata.

from  CacheableResponseTrait
protected array $attachments

The attachments for this response.

from  AttachmentsTrait
protected BigPipe $bigPipe

The BigPipe service.

protected HtmlResponse $originalHtmlResponse

The original HTML response.

Methods

addCacheableDependency($dependency)

{@inheritdoc}

getAttachments()

{@inheritdoc}

addAttachments(array $attachments)

{@inheritdoc}

setAttachments(array $attachments)

{@inheritdoc}

__construct(HtmlResponse $response)

Constructs a new BigPipeResponse.

$this
setContent(mixed $content)

Sets the response content.

getOriginalHtmlResponse()

Returns the original HTML response.

populateBasedOnOriginalHtmlResponse()

Populates this BigPipeResponse object based on the original HTML response.

setBigPipeService(BigPipe $big_pipe)

Sets the BigPipe service to use.

sendContent()

{@inheritdoc}

Details

addCacheableDependency($dependency)

{@inheritdoc}

Parameters

$dependency

getCacheableMetadata()

{@inheritdoc}

getAttachments()

{@inheritdoc}

addAttachments(array $attachments)

{@inheritdoc}

Parameters

array $attachments

setAttachments(array $attachments)

{@inheritdoc}

Parameters

array $attachments

__construct(HtmlResponse $response)

Constructs a new BigPipeResponse.

Parameters

HtmlResponse $response

The original HTML response.

$this setContent(mixed $content)

Sets the response content.

Parameters

mixed $content

Content that can be cast to string, or a render array.

Return Value

$this

HtmlResponse getOriginalHtmlResponse()

Returns the original HTML response.

Return Value

HtmlResponse

The original HTML response.

protected populateBasedOnOriginalHtmlResponse()

Populates this BigPipeResponse object based on the original HTML response.

setBigPipeService(BigPipe $big_pipe)

Sets the BigPipe service to use.

Parameters

BigPipe $big_pipe

The BigPipe service.

sendContent()

{@inheritdoc}