Skip to content

Commit d8e65fb

Browse files
committed
Consistent naming for event loop implementations
1 parent ffe26e9 commit d8e65fb

File tree

9 files changed

+34
-34
lines changed

9 files changed

+34
-34
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ For the code of the current stable 0.4.x release, checkout the
2222
* [create()](#create)
2323
* [Loop implementations](#loop-implementations)
2424
* [StreamSelectLoop](#streamselectloop)
25-
* [LibEventLoop](#libeventloop)
26-
* [LibEvLoop](#libevloop)
2725
* [ExtEventLoop](#exteventloop)
26+
* [ExtLibeventLoop](#extlibeventloop)
27+
* [ExtLibevLoop](#extlibevloop)
2828
* [LoopInterface](#loopinterface)
2929
* [addtimer()](#addtimer)
3030
* [addPeriodicTimer()](#addperiodictimer)
@@ -184,7 +184,16 @@ It is commonly installed as part of many PHP distributions.
184184
If this extension is missing (or you're running on Windows), signal handling is
185185
not supported and throws a `BadMethodCallException` instead.
186186

187-
#### LibEventLoop
187+
#### ExtEventLoop
188+
189+
An `ext-event` based event loop.
190+
191+
This uses the [`event` PECL extension](https://pecl.php.net/package/event).
192+
It supports the same backends as libevent.
193+
194+
This loop is known to work with PHP 5.4 through PHP 7+.
195+
196+
#### ExtLibeventLoop
188197

189198
An `ext-libevent` based event loop.
190199

@@ -198,7 +207,7 @@ To reiterate: Using this event loop on PHP 7 is not recommended.
198207
Accordingly, the [`Factory`](#factory) will not try to use this event loop on
199208
PHP 7.
200209

201-
#### LibEvLoop
210+
#### ExtLibevLoop
202211

203212
An `ext-libev` based event loop.
204213

@@ -209,15 +218,6 @@ This loop does only work with PHP 5.
209218
An update for PHP 7 is [unlikely](https://github.com/m4rw3r/php-libev/issues/8)
210219
to happen any time soon.
211220

212-
#### ExtEventLoop
213-
214-
An `ext-event` based event loop.
215-
216-
This uses the [`event` PECL extension](https://pecl.php.net/package/event).
217-
It supports the same backends as libevent.
218-
219-
This loop is known to work with PHP 5.4 through PHP 7+.
220-
221221
### LoopInterface
222222

223223
#### addTimer()

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"phpunit/phpunit": "~4.8.35 || ^5.7 || ^6.4"
1111
},
1212
"suggest": {
13-
"ext-libevent": ">=0.1.0 for LibEventLoop and PHP5 only",
1413
"ext-event": "~1.0 for ExtEventLoop",
15-
"ext-libev": "for LibEvLoop",
16-
"ext-pcntl": "For signals support when using the stream_select loop"
14+
"ext-libevent": ">=0.1.0 for ExtLibeventLoop and PHP 5 only",
15+
"ext-libev": "for ExtLibevLoop and PHP 5 only",
16+
"ext-pcntl": "For signal handling support when using the StreamSelectLoop"
1717
},
1818
"autoload": {
1919
"psr-4": {

src/LibEvLoop.php renamed to src/ExtLibevLoop.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* @see https://github.com/m4rw3r/php-libev
2525
* @see https://gist.github.com/1688204
2626
*/
27-
class LibEvLoop implements LoopInterface
27+
class ExtLibevLoop implements LoopInterface
2828
{
2929
private $loop;
3030
private $futureTickQueue;

src/LibEventLoop.php renamed to src/ExtLibeventLoop.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*
2525
* @link https://pecl.php.net/package/libevent
2626
*/
27-
class LibEventLoop implements LoopInterface
27+
class ExtLibeventLoop implements LoopInterface
2828
{
2929
const MICROSECONDS_PER_SECOND = 1000000;
3030

src/Factory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ public static function create()
2525
{
2626
// @codeCoverageIgnoreStart
2727
if (class_exists('libev\EventLoop', false)) {
28-
return new LibEvLoop;
28+
return new ExtLibevLoop();
2929
} elseif (class_exists('EventBase', false)) {
30-
return new ExtEventLoop;
30+
return new ExtEventLoop();
3131
} elseif (function_exists('event_base_new') && PHP_VERSION_ID < 70000) {
3232
// only use ext-libevent on PHP < 7 for now
33-
return new LibEventLoop();
33+
return new ExtLibeventLoop();
3434
}
3535

3636
return new StreamSelectLoop();

tests/LibEvLoopTest.php renamed to tests/ExtLibevLoopTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
namespace React\Tests\EventLoop;
44

5-
use React\EventLoop\LibEvLoop;
5+
use React\EventLoop\ExtLibevLoop;
66

7-
class LibEvLoopTest extends AbstractLoopTest
7+
class ExtLibevLoopTest extends AbstractLoopTest
88
{
99
public function createLoop()
1010
{
1111
if (!class_exists('libev\EventLoop')) {
1212
$this->markTestSkipped('libev tests skipped because ext-libev is not installed.');
1313
}
1414

15-
return new LibEvLoop();
15+
return new ExtLibevLoop();
1616
}
1717

1818
public function testLibEvConstructor()
1919
{
20-
$loop = new LibEvLoop();
20+
$loop = new ExtLibevLoop();
2121
}
2222
}

tests/LibEventLoopTest.php renamed to tests/ExtLibeventLoopTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace React\Tests\EventLoop;
44

5-
use React\EventLoop\LibEventLoop;
5+
use React\EventLoop\ExtLibeventLoop;
66

7-
class LibEventLoopTest extends AbstractLoopTest
7+
class ExtLibeventLoopTest extends AbstractLoopTest
88
{
99
private $fifoPath;
1010

@@ -18,7 +18,7 @@ public function createLoop()
1818
$this->markTestSkipped('libevent tests skipped because ext-libevent is not installed.');
1919
}
2020

21-
return new LibEventLoop();
21+
return new ExtLibeventLoop();
2222
}
2323

2424
public function tearDown()

tests/Timer/LibEvTimerTest.php renamed to tests/Timer/ExtLibevTimerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
namespace React\Tests\EventLoop\Timer;
44

5-
use React\EventLoop\LibEvLoop;
5+
use React\EventLoop\ExtLibevLoop;
66

7-
class LibEvTimerTest extends AbstractTimerTest
7+
class ExtLibevTimerTest extends AbstractTimerTest
88
{
99
public function createLoop()
1010
{
1111
if (!class_exists('libev\EventLoop')) {
1212
$this->markTestSkipped('libev tests skipped because ext-libev is not installed.');
1313
}
1414

15-
return new LibEvLoop();
15+
return new ExtLibevLoop();
1616
}
1717
}

tests/Timer/LibEventTimerTest.php renamed to tests/Timer/ExtLibeventTimerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
namespace React\Tests\EventLoop\Timer;
44

5-
use React\EventLoop\LibEventLoop;
5+
use React\EventLoop\ExtLibeventLoop;
66

7-
class LibEventTimerTest extends AbstractTimerTest
7+
class ExtLibeventTimerTest extends AbstractTimerTest
88
{
99
public function createLoop()
1010
{
1111
if (!function_exists('event_base_new')) {
1212
$this->markTestSkipped('libevent tests skipped because ext-libevent is not installed.');
1313
}
1414

15-
return new LibEventLoop();
15+
return new ExtLibeventLoop();
1616
}
1717
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy