File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ Suspensions allow awaiting an event by suspending the current execution context
15
15
They will suspend the current fiber and return to the event loop, or start running the event loop if called from outside a fiber, i.e. from ` {main} ` .
16
16
17
17
Fibers should be suspended and resumed using the ` Revolt\EventLoop\Suspension ` API.
18
- ` Suspension ` objects can be created using ` Revolt\EventLoop::createSuspension () ` .
18
+ ` Suspension ` objects can be created using ` Revolt\EventLoop::getSuspension () ` .
19
19
After obtaining a ` Suspension ` object, an event callback can be registered to schedule the resumption of the current fiber.
20
20
` $suspension->suspend() ` will suspend the current execution context until it is resumed via ` $suspension->resume() ` or ` $suspension->throw() ` .
21
21
@@ -37,7 +37,7 @@ if (\stream_set_blocking(STDIN, false) !== true) {
37
37
38
38
print "Write something and hit enter" . PHP_EOL;
39
39
40
- $suspension = EventLoop::createSuspension ();
40
+ $suspension = EventLoop::getSuspension ();
41
41
42
42
$readableId = EventLoop::onReadable(STDIN, function ($id, $stream) use ($suspension): void {
43
43
EventLoop::cancel($id);
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ require __DIR__ . '/vendor/autoload.php';
66
66
67
67
use Revolt\EventLoop;
68
68
69
- $suspension = EventLoop::createSuspension ();
69
+ $suspension = EventLoop::getSuspension ();
70
70
71
71
$repeatId = EventLoop::repeat(1, function (): void {
72
72
print '++ Executing callback created by EventLoop::repeat()' . PHP_EOL;
@@ -120,7 +120,7 @@ if (\stream_set_blocking(STDIN, false) !== true) {
120
120
121
121
print "Write something and hit enter" . PHP_EOL;
122
122
123
- $suspension = EventLoop::createSuspension ();
123
+ $suspension = EventLoop::getSuspension ();
124
124
125
125
$readableId = EventLoop::onReadable(STDIN, function ($id, $stream) use ($suspension): void {
126
126
EventLoop::cancel($id);
You can’t perform that action at this time.
0 commit comments