Scope::isCancelled
(PHP 8.6+, True Async 1.0)
public function isCancelled(): bool
Checks whether the scope has been cancelled. A scope is marked as cancelled after a call to cancel() or dispose().
Return Value
bool — true if the scope has been cancelled, false otherwise.
Examples
Example #1 Checking scope cancellation
<?php
use Async\Scope;
$scope = new Scope();
var_dump($scope->isCancelled()); // bool(false)
$scope->cancel();
var_dump($scope->isCancelled()); // bool(true)
See Also
- Scope::cancel — Cancel the scope
- Scope::isFinished — Check if the scope is finished
- Scope::isClosed — Check if the scope is closed