forked from EdmondDantes/php-true-async-rfc
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCoroutine.php
More file actions
95 lines (75 loc) · 2.04 KB
/
Copy pathCoroutine.php
File metadata and controls
95 lines (75 loc) · 2.04 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
<?php
declare(strict_types=1);
namespace Async;
final class Coroutine implements Awaitable
{
/**
* 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 debug trace.
*/
public function getTrace(): 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.
*/
function isCancellationRequested(): bool {}
/**
* Return true if the coroutine is finished.
*/
public function isFinished(): bool {}
/**
* Return awaiting debug information.
*/
public function getAwaitingInfo(): array {}
/**
* Cancel the coroutine.
*/
public function cancel(CancellationException $cancellationException): void {}
/**
* Define a callback to be executed when the coroutine is finished.
*/
public function onFinally(\Closure $callback): void {}
}