CakeFest 2024: The Official CakePHP Conference

Worker::isShutdown

(PECL pthreads >= 2.0.0)

Worker::isShutdown状态检测

说明

public Worker::isShutdown(): bool

Worker 对象是否被关闭

参数

此函数没有参数。

返回值

布尔值,表示 worker 是否已经被关闭

示例

示例 #1 检测 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