TaskSet::isSealed

(PHP 8.6+, True Async 1.0)

public TaskSet::isSealed(): bool

Returns 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

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