1

有一个 php 库https://github.com/tarantool-php/queue,但它需要 ext-tarantool,所以有没有纯 php 编写的活动可维护库,它允许我们在 php 5.6 或 7 中使用 tarantool queue ? 或者是否有任何现成的包可供centos 为php5.6 安装ext-tarantool? yum install php-tarantool给出以下不兼容错误

Error: Package: php-tarantool-0.1.0-19.el6.x86_64 (tarantool_1_6)
          Requires: php(zend-abi) = 20090626
          Installed: php-common-5.6.19-1.el6.remi.x86_64 (@remi-php56)
              php(zend-abi) = 20131226-64
4

1 回答 1

1

我是 tarantool-php/queue 库的作者。我计划在未来添加对纯 PHP Tarantool 客户端的支持,只是还没有。填写免费提交票;)

同时,作为一种解决方法,您可以Tarantool\Client使用\Tarantool类进行装饰,例如:

use Tarantool\Client;

class Tarantool
{
    private $client;

    public function __construct(Client $client)
    {
        $this->client = $client;
    }

    public function call($functionName, array $args = null)
    {
        $result = $this->client->call($functionName, $args ? $args : []);

        return $result->getData();
    }
}

然后像这样使用它:

use Tarantool\Client;
use Tarantool\Connection\SocketConnection;
use Tarantool\Packer\PurePacker;
use Tarantool\Queue\Queue;

$client = new Client(new SocketConnection(), new PurePacker());
$client = new Tarantool($client);

$queue = new Queue($client, 'foobar');
于 2016-03-24T13:04:41.703 回答