Skip to content

Pass options to predis client when using redis transport #367

New issue

Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “No Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? No Sign in to your account

Closed
fvaresi opened this issue Feb 12, 2018 · 1 comment
Closed

Pass options to predis client when using redis transport #367

fvaresi opened this issue Feb 12, 2018 · 1 comment

Comments

@fvaresi
Copy link

fvaresi commented Feb 12, 2018

It would be nice to be able to pass client options to predis transport.

Example:

<?php
use Enqueue\Redis\RedisConnectionFactory;

$connectionFactory = new RedisConnectionFactory([
    'host' => 'localhost',
    'port' => 6379,
    'vendor' => 'predis',
    ...
    'options' => ['cluster' => 'predis', ...],
]);
@makasim
Copy link
Member

makasim commented Feb 15, 2018

This will be possible once #372 is merged. Like this:

<?php
use Enqueue\Redis\RedisConnectionFactory;

use Enqueue\Redis\PRedis;
 
$config = [
    'host' => 'localhost',
    'port' => 6379,
    'vendor' => 'predis',
]; 
$options = ['cluster' => 'predis'];

$redis = new PRedis(new \PRedis\Client($config, $options));

$connectionFactory = new RedisConnectionFactory([
    'redis' => $redis,
    'vendor' => 'custom',
]);

No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants