php8.5
Home/ Manual/ parallel / future/ parallel\Future::cancel

parallel\Future::cancel

PHP function Edit on GitHub ✎

(0.9.0)

Cancellation

Description

parallel\Future::cancel(): bool

Shall try to cancel the task

Note

If task is running, it will be interrupted.

Warning

Internal function calls in progress cannot be interrupted.

Exceptions

Warning

Shall throw parallel\Future\Error\Killed if parallel\Runtime executing task was killed.

Warning

Shall throw parallel\Future\Error\Cancelled if task was already cancelled.

Source: reference/parallel/parallel/future/cancel.xml · from the official PHP manual (php/doc-en)