1

There is a php library https://github.com/tarantool-php/queue, but it requires ext-tarantool, so is there any active maintainable library written purely in php, which allow us to use tarantool queue in php 5.6 or 7? Or is there any ready package for centos to install ext-tarantool for php5.6? yum install php-tarantool gives following incompatibility error

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
2
  • AFAIK, there is no repository with this package. As you are using php from "remi-php56", should ask on github.com/remicollet/remirepo if possible to add this extension in the repository Commented Mar 24, 2016 at 12:21
  • There is new package in remi repository that solves our problem php-tarantool.x86_64 0:0.1.0-1.el6.remi.5.6 Commented May 18, 2016 at 15:34

1 Answer 1

1

I'm the author of the tarantool-php/queue library. I plan to add support for the pure PHP Tarantool client in the future, it's just not there yet. Fill free to file a ticket for that ;)

In a meanwhile, as a workaround, you can decorate Tarantool\Client with the \Tarantool class, e.g.:

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

And then use it like this:

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');
Sign up to request clarification or add additional context in comments.

1 Comment

UPDATE: Since version 0.4.0, tarantool/queue comes with built-in support for the pure PHP client.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.