Scope::isCancelled

(PHP 8.6+, True Async 1.0)

public function isCancelled(): bool

스코프가 취소되었는지 확인합니다. 스코프는 cancel() 또는 dispose() 호출 후 취소됨으로 표시됩니다.

반환값

bool — 스코프가 취소된 경우 true, 그렇지 않으면 false.

예제

예제 #1 스코프 취소 확인

<?php

use Async\Scope;

$scope = new Scope();

var_dump($scope->isCancelled()); // bool(false)

$scope->cancel();

var_dump($scope->isCancelled()); // bool(true)

참고