php8.5
Home/ Manual/ pthreads / worker/ Worker::isShutdown

Worker::isShutdown

PHP function Edit on GitHub ✎

(PECL pthreads >= 2.0.0)

State Detection

Description

Worker::isShutdown(): bool

Whether the worker has been shutdown or not.

Parameters Parameters

Return Values

Returns whether the worker has been shutdown or not.

Examples

Detect the state of a worker

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

var_dump($worker->isShutdown());

$worker->shutdown();

var_dump($worker->isShutdown());

The above example will output:

output
bool(false)
bool(true)

Source: reference/pthreads/worker/isshutdown.xml · from the official PHP manual (php/doc-en)