-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcoroutine.stub.php
More file actions
119 lines (97 loc) · 2.88 KB
/
coroutine.stub.php
File metadata and controls
119 lines (97 loc) · 2.88 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
/** @generate-class-entries */
namespace Async;
/**
* @strict-properties
* @not-serializable
*/
final class Coroutine implements Completable
{
/**
* Returns the Coroutine ID.
*/
public function getId(): int {}
/**
* Marks the Coroutine as high priority.
*/
public function asHiPriority(): Coroutine {}
/**
* Returns the Coroutine local-context.
*/
public function getContext(): Context {}
/**
* Returns the Coroutine result when finished.
* If the Coroutine is not finished, it will return null.
*/
public function getResult(): mixed {}
/**
* Returns the Coroutine exception when finished.
* If the Coroutine is not finished, it will return null.
* If the Coroutine is cancelled, it will return a AsyncCancellation.
*
* @throws \RuntimeException if the Coroutine is running
*/
public function getException(): mixed {}
/**
* Returns the Coroutine debug trace.
* If the coroutine is in the suspended state, returns a backtrace array.
* Otherwise, returns null.
*
* @param int $options Options for the backtrace (DEBUG_BACKTRACE_PROVIDE_OBJECT, DEBUG_BACKTRACE_IGNORE_ARGS)
* @param int $limit Maximum number of stack frames to return (0 for no limit)
*/
public function getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT, int $limit = 0): ?array {}
/**
* Return spawn file and line.
*/
public function getSpawnFileAndLine(): array {}
/**
* Return spawn location as string.
*/
public function getSpawnLocation(): string {}
/**
* Return suspend file and line.
*/
public function getSuspendFileAndLine(): array {}
/**
* Return suspend location as string.
*/
public function getSuspendLocation(): string {}
/**
* Return true if the coroutine is started.
*/
public function isStarted(): bool {}
public function isQueued(): bool {}
/**
* Return true if the coroutine is running.
*/
public function isRunning(): bool {}
/**
* Return true if the coroutine is suspended.
*/
public function isSuspended(): bool {}
/**
* Return true if the coroutine is cancelled.
*/
public function isCancelled(): bool {}
/**
* Return true if the coroutine is cancellation requested.
*/
public function isCancellationRequested(): bool {}
/**
* Return true if the coroutine is completed.
*/
public function isCompleted(): bool {}
/**
* Return awaiting debug information.
*/
public function getAwaitingInfo(): array {}
/**
* Cancel the coroutine.
*/
public function cancel(?AsyncCancellation $cancellation = null): void {}
/**
* Define a callback to be executed when the coroutine is finished.
*/
public function finally(\Closure $callback): void {}
}