title: Predis is giving 'Error while reading line from server'
body: <p>I am using <a href="https://github.com/nrk/predis" rel="nofollow noreferrer">predis</a>, it's subscribed to a channel and listening. It throws the following error (below) and dies after 60 secs exactly. It's surely not my web servers error or its timeout.</p>
  <p>There is a similar issue being discussed <a href="https://github.com/nrk/predis/issues/32" rel="nofollow noreferrer">here</a>. Could not get much of it.</p>
  <p>I tried setting connection_timeout in predis conf file to 0, but doesn't helps much.</p>
  <p>Also if i keep using (send data to it and it processes) the worker it doesn't give any error. So its likely a timeout somewhere, and that too in connection.</p>
  <p>Here is my code snippet, which is likely producing error, because if data is given to worker it runs this code and go forward, which produces no error after that.</p>
  <pre><code>$pubsub = $redis-&gt;pubSub();
  $pubsub-&gt;subscribe($channel1);
  
  foreach ($pubsub as $message) { //doing stuff here and unsubscribing from channel
  }
  </code></pre>
  <p>Trace</p>
  <pre><code>PHP Fatal error:  Uncaught exception 'Predis\Network\ConnectionException' with message 'Error while reading line from the server' in Predis/Network/ConnectionBase.php:159 Stack trace:
  #0 library/vendor/predis/lib/Predis/Network/StreamConnection.php(195): Predis\Network\ConnectionBase-&gt;onConnectionError('Error while rea...')
  #1 library/vendor/predis/lib/Predis/PubSub/PubSubContext.php(259): Predis\Network\StreamConnection-&gt;read()
  #2 library/vendor/predis/lib/Predis/PubSub/PubSubContext.php(206): Predis\PubSub\PubSubContext-&gt;getValue()
  #3 pdf/file.php(16): Predis\PubSub\PubSubContext-&gt;current()
  #4 {main}   thrown in Predis/Network/ConnectionBase.php on line 159
  </code></pre>
  <p>Checked the redis.conf timeout too, its also disabled.</p>