Skip to content

Commit b0fe41b

Browse files
committed
Rename await() to timeout()
Closes #10
1 parent 2c4c576 commit b0fe41b

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use React\Promise\PromiseInterface;
88
use React\Promise\Promise;
99

10-
function await(PromiseInterface $promise, $time, LoopInterface $loop)
10+
function timeout(PromiseInterface $promise, $time, LoopInterface $loop)
1111
{
1212
return new Promise(function ($resolve, $reject) use ($loop, $time, $promise) {
1313
$timer = $loop->addTimer($time, function () use ($time, $promise, $reject) {
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
use Clue\Promise\Timeout;
44
use React\Promise;
55

6-
class FunctionAwaitTest extends TestCase
6+
class FunctionTimeoutTest extends TestCase
77
{
88
public function testResolvedWillResolveRightAway()
99
{
1010
$promise = Promise\resolve();
1111

12-
$promise = Timeout\await($promise, 3, $this->loop);
12+
$promise = Timeout\timeout($promise, 3, $this->loop);
1313

1414
$this->expectPromiseResolved($promise);
1515
}
@@ -18,7 +18,7 @@ public function testResolvedWillNotStartTimer()
1818
{
1919
$promise = Promise\resolve();
2020

21-
Timeout\await($promise, 3, $this->loop);
21+
Timeout\timeout($promise, 3, $this->loop);
2222

2323
$time = microtime(true);
2424
$this->loop->run();
@@ -31,7 +31,7 @@ public function testRejectedWillRejectRightAway()
3131
{
3232
$promise = Promise\reject();
3333

34-
$promise = Timeout\await($promise, 3, $this->loop);
34+
$promise = Timeout\timeout($promise, 3, $this->loop);
3535

3636
$this->expectPromiseRejected($promise);
3737
}
@@ -40,7 +40,7 @@ public function testRejectedWillNotStartTimer()
4040
{
4141
$promise = Promise\reject();
4242

43-
Timeout\await($promise, 3, $this->loop);
43+
Timeout\timeout($promise, 3, $this->loop);
4444

4545
$time = microtime(true);
4646
$this->loop->run();
@@ -53,7 +53,7 @@ public function testPendingWillRejectOnTimeout()
5353
{
5454
$promise = $this->getMock('React\Promise\PromiseInterface');
5555

56-
$promise = Timeout\await($promise, 0.01, $this->loop);
56+
$promise = Timeout\timeout($promise, 0.01, $this->loop);
5757

5858
$this->loop->run();
5959

@@ -70,7 +70,7 @@ public function testPendingCancellableWillBeCancelledOnTimeout()
7070
$promise->expects($this->once())->method('cancel');
7171

7272

73-
Timeout\await($promise, 0.01, $this->loop);
73+
Timeout\timeout($promise, 0.01, $this->loop);
7474

7575
$this->loop->run();
7676
}

0 commit comments

Comments
 (0)