diff --git a/VERSION b/VERSION index d510910..746bd19 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.0-dev +0.3.1-dev diff --git a/composer.json b/composer.json index 9d6eaa3..1ae7361 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "require": { "php": ">=5.4.0", "predis/predis": "^1.0", - "react/event-loop": "~0.4", + "react/event-loop": "~1.0", "clue/redis-protocol": "~0.3" }, "require-dev": { diff --git a/src/Connection/AbstractConnection.php b/src/Connection/AbstractConnection.php index ec9d025..892ea35 100644 --- a/src/Connection/AbstractConnection.php +++ b/src/Connection/AbstractConnection.php @@ -169,15 +169,11 @@ protected function createResource(callable $callback) */ protected function armTimeoutMonitor($timeout, callable $callback) { - $timer = $this->loop->addTimer($timeout, function ($timer) { - list($connection, $callback) = $timer->getData(); - - $connection->disconnect(); - call_user_func($callback, $connection, new ConnectionException($connection, 'Connection timed out')); + $timer = $this->loop->addTimer($timeout, function ($timer) use ($callback) { + $this->disconnect(); + call_user_func($callback, $this, new ConnectionException($this, 'Connection timed out')); }); - $timer->setData([$this, $callback]); - return $timer; }