function HoldTestSubscriber::hold

Same name in other branches
  1. 8.9.x core/modules/system/tests/modules/hold_test/src/EventSubscriber/HoldTestSubscriber.php \Drupal\hold_test\EventSubscriber\HoldTestSubscriber::hold()
  2. 10 core/modules/system/tests/modules/hold_test/src/EventSubscriber/HoldTestSubscriber.php \Drupal\hold_test\EventSubscriber\HoldTestSubscriber::hold()
  3. 11.x core/modules/system/tests/modules/hold_test/src/EventSubscriber/HoldTestSubscriber.php \Drupal\hold_test\EventSubscriber\HoldTestSubscriber::hold()

Hold process by type.

Parameters

string $type: Type of hold.

2 calls to HoldTestSubscriber::hold()
HoldTestSubscriber::onRequest in core/modules/system/tests/modules/hold_test/src/EventSubscriber/HoldTestSubscriber.php
Request hold.
HoldTestSubscriber::onRespond in core/modules/system/tests/modules/hold_test/src/EventSubscriber/HoldTestSubscriber.php
Response hold.

File

core/modules/system/tests/modules/hold_test/src/EventSubscriber/HoldTestSubscriber.php, line 60

Class

HoldTestSubscriber
Response subscriber to test hold.

Namespace

Drupal\hold_test\EventSubscriber

Code

protected function hold($type) {
    $path = "{$this->sitePath}/hold_test_{$type}.txt";
    do {
        $status = (bool) file_get_contents($path);
    } while ($status && NULL === usleep(static::WAIT));
}

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