Dutch PHP Conference 2025 - Call For Papers

Worker::isShutdown

(PECL pthreads >= 2.0.0)

Worker::isShutdownState Detection

Опис

public Worker::isShutdown(): bool

Whether the worker has been shutdown or not.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

Returns whether the worker has been shutdown or not.

Приклади

Приклад #1 Detect the state of a worker

<?php
$worker
= new Worker();
$worker->start();

var_dump($worker->isShutdown());

$worker->shutdown();

var_dump($worker->isShutdown());

Поданий вище приклад виведе:

bool(false)
bool(true)

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top