Skip to content

Commit 87fbae6

Browse files
committed
Merge pull request #8 from clue-labs/sleep
Rename wait() to sleep() in order to avoid confusion with await*()
2 parents 0ee1990 + c8d1e77 commit 87fbae6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ $loop = React\EventLoop\Factory::create();
6565
$blocker = new Blocker($loop);
6666
```
6767

68-
#### wait()
68+
#### sleep()
6969

70-
The `wait($seconds)` method can be used to wait/sleep for $time seconds.
70+
The `sleep($seconds)` method can be used to wait/sleep for $time seconds.
7171

7272
#### awaitOne()
7373

src/Blocker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(LoopInterface $loop)
2222
*
2323
* @param float $time
2424
*/
25-
public function wait($time)
25+
public function sleep($time)
2626
{
2727
$wait = true;
2828
$loop = $this->loop;

tests/BlockerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ public function setUp()
1414
$this->block = new Blocker($this->loop);
1515
}
1616

17-
public function testWait()
17+
public function testSleep()
1818
{
1919
$time = microtime(true);
20-
$this->block->wait(0.2);
20+
$this->block->sleep(0.2);
2121
$time = microtime(true) - $time;
2222

2323
$this->assertEquals(0.2, $time, '', 0.1);

0 commit comments

Comments
 (0)