Skip to content

Commit

Permalink
Merge pull request #6 from tioncico/master
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
evalor authored Jun 16, 2019
2 parents f6026f0 + 5271958 commit 218a2fa
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Config extends SplBean
protected $port;
protected $auth;
protected $options = [];
protected $serialize=false;
protected $timeout = 3;

/**
Expand Down Expand Up @@ -93,4 +94,21 @@ public function setTimeout(int $timeout): void
{
$this->timeout = $timeout;
}

/**
* @return bool
*/
public function getSerialize(): bool
{
return $this->serialize;
}

/**
* @param bool $serialize
*/
public function setSerialize(bool $serialize): void
{
$this->serialize = $serialize;
}

}
2 changes: 1 addition & 1 deletion src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use EasySwoole\Component\Pool\PoolObjectInterface;

class Connection extends \Redis implements PoolObjectInterface
class Connection extends \Swoole\Coroutine\Redis implements PoolObjectInterface
{
function gc()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected function createObject()
{
$config = $this->getConfig()->getExtraConf();
$conn = new Connection();
$ret = $conn->connect($config->getHost(),$config->getPort(),$config->getTimeout());
$ret = $conn->connect($config->getHost(),$config->getPort(),$config->getSerialize());
if(!$ret){
return;
}
Expand Down

0 comments on commit 218a2fa

Please sign in to comment.