Worker::isShutdown

(PECL pthreads >= 2.0.0)

Worker::isShutdownState Detection

Descrição

public Worker::isShutdown(): bool

Whether the worker has been shutdown or not.

Parâmetros

Esta função não possui parâmetros.

Valor Retornado

Returns whether the worker has been shutdown or not.

Exemplos

Example #1 Detect the state of a worker

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

var_dump($worker->isShutdown());

$worker->shutdown();

var_dump($worker->isShutdown());

O exemplo acima produzirá:

bool(false)
bool(true)