mirror of
https://github.com/danog/amp.git
synced 2025-01-22 05:11:42 +01:00
minor timeout function/test cleanup
This commit is contained in:
parent
34088cbf52
commit
e923ea3fde
@ -448,7 +448,6 @@ function timeout(Promise $promise, $msTimeout, Reactor $reactor = null) {
|
||||
if ($resolved) {
|
||||
return;
|
||||
}
|
||||
|
||||
$reactor->cancel($watcherId);
|
||||
if ($error) {
|
||||
$promisor->fail($error);
|
||||
|
@ -167,7 +167,7 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase {
|
||||
* @expectedExceptionMessage Promise resolution timed out
|
||||
*/
|
||||
public function testTimeout() {
|
||||
(new NativeReactor)->run(function($reactor) use (&$invoked) {
|
||||
(new NativeReactor)->run(function($reactor) {
|
||||
$pause = new \Amp\Pause(1000, $reactor);
|
||||
yield \Amp\timeout($pause, 10, $reactor);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user