-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtask_set.stub.php
More file actions
64 lines (47 loc) · 1.86 KB
/
task_set.stub.php
File metadata and controls
64 lines (47 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/** @generate-class-entries */
namespace Async;
/**
* TaskSet is a mutable task collection with auto-cleanup.
* Completed tasks are automatically removed after their results
* are consumed via joinNext(), joinAny(), joinAll(), or iteration.
*
* @strict-properties
* @not-serializable
*/
final class TaskSet implements Awaitable, \Countable, \IteratorAggregate
{
/**
* @param int|null $concurrency Maximum number of concurrent coroutines.
* @param Scope|null $scope Parent scope.
*/
public function __construct(?int $concurrency = null, ?Scope $scope = null) {}
public function spawn(callable $task, mixed ...$args): void {}
public function spawnWithKey(string|int $key, callable $task, mixed ...$args): void {}
/**
* Return a Future that resolves or rejects with the first settled task.
* The completed entry is automatically removed from the set.
*/
public function joinNext(): Future {}
/**
* Return a Future that resolves with the first successfully completed task.
* The completed entry is automatically removed from the set.
*/
public function joinAny(): Future {}
/**
* Return a Future that resolves with all task results.
* All entries are automatically removed from the set after delivery.
*
* @param bool $ignoreErrors If true, errors are excluded from results.
*/
public function joinAll(bool $ignoreErrors = false): Future {}
public function cancel(?AsyncCancellation $cancellation = null): void {}
public function seal(): void {}
public function dispose(): void {}
public function isFinished(): bool {}
public function isSealed(): bool {}
public function count(): int {}
public function awaitCompletion(): void {}
public function finally(\Closure $callback): void {}
public function getIterator(): \Iterator {}
}