TaskSet::isSealed
(PHP 8.6+, True Async 1.0)
php
public TaskSet::isSealed(): boolReturns true if the set is sealed (seal() or cancel() was called).
Return Value
true if the set is sealed. false otherwise.
Examples
Example #1 Checking state
php
<?php
use Async\TaskSet;
spawn(function() {
$set = new TaskSet();
echo $set->isSealed() ? "yes\n" : "no\n"; // "no"
$set->seal();
echo $set->isSealed() ? "yes\n" : "no\n"; // "yes"
});See Also
- TaskSet::seal — Seal the set
- TaskSet::isFinished — Check if tasks are finished