function TurtleLazyBuilder::turtle

Same name in other branches
  1. 10 core/modules/big_pipe/tests/src/Unit/Render/FiberPlaceholderTest.php \Drupal\Tests\big_pipe\Unit\Render\TurtleLazyBuilder::turtle()

#lazy_builder callback.

Suspends its own execution twice to simulate long operation.

Return value

array

File

core/modules/big_pipe/tests/src/Unit/Render/FiberPlaceholderTest.php, line 122

Class

TurtleLazyBuilder

Namespace

Drupal\Tests\big_pipe\Unit\Render

Code

public static function turtle() : array {
    if (\Fiber::getCurrent() !== NULL) {
        \Fiber::suspend();
    }
    if (\Fiber::getCurrent() !== NULL) {
        \Fiber::suspend();
    }
    return [
        '#markup' => '<span>Turtle is finally here. But how?</span>',
    ];
}

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