1
0
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:
Daniel Lowrey 2015-05-31 20:18:42 -04:00
parent 34088cbf52
commit e923ea3fde
2 changed files with 1 additions and 2 deletions

View File

@ -448,7 +448,6 @@ function timeout(Promise $promise, $msTimeout, Reactor $reactor = null) {
if ($resolved) {
return;
}
$reactor->cancel($watcherId);
if ($error) {
$promisor->fail($error);

View File

@ -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);
});