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

Worker::shutdown

PHP function Edit on GitHub ✎

(PECL pthreads >= 2.0.0)

Shutdown the worker

Description

Worker::shutdown(): bool

Shuts down the worker after executing all of the stacked tasks.

Parameters Parameters

Return Values

Success

Examples

Shutdown the referenced worker

php
<?php
$my = new Worker();
$my->start();
/* stack/execute tasks */
var_dump($my->shutdown());

The above example will output:

output
bool(true)

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