function HoldTestSubscriber::hold

Same name in other branches
  1. 9 core/modules/system/tests/modules/hold_test/src/EventSubscriber/HoldTestSubscriber.php \Drupal\hold_test\EventSubscriber\HoldTestSubscriber::hold()
  2. 8.9.x core/modules/system/tests/modules/hold_test/src/EventSubscriber/HoldTestSubscriber.php \Drupal\hold_test\EventSubscriber\HoldTestSubscriber::hold()
  3. 10 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 62

Class

HoldTestSubscriber
Response subscriber to test hold.

Namespace

Drupal\hold_test\EventSubscriber

Code

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

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