Framework: Redis subscribe timeout and does not log new messages

Created on 19 Jun 2015  路  1Comment  路  Source: laravel/framework

Hi,
Im on 5.1 and trying out the new redis pub/sub feature

I created a console command which subscribes to a channel, i have socket.io server setup and client side is broadcasting to the channel through socket.io emit.

When i run the console command, it works but when it does not received any new messages from client. after 60seconds, it shows an error

  [Predis\Connection\ConnectionException]
  Error while reading line from the server. [tcp://127.0.0.1:6379]

I looked up and found out
http://stackoverflow.com/questions/11776029/predis-is-giving-error-while-reading-line-from-server
How do i append a ?read_write_timeout=0 to the connection string.

Here's my subscription code

 Redis::subscribe(['main-channel'], function($message) {
            $this->info($message);
});

Note: Redis::publish works fine, it is able to publish to the main channel.

>All comments

I think what you are looking for, can be found in here https://github.com/nrk/predis/wiki/Connection-Parameters

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PhiloNL picture PhiloNL  路  3Comments

SachinAgarwal1337 picture SachinAgarwal1337  路  3Comments

felixsanz picture felixsanz  路  3Comments

kerbylav picture kerbylav  路  3Comments

CupOfTea696 picture CupOfTea696  路  3Comments