As Fenn said it won't know not to reconnect immediately, but it should
not matter, as this is hopefully going to be a rare case.
I run an every-minute cron job, which checks for a keep-alive file every
20 seconds. If the keep-alive file is older than 66 seconds, then it
does a forced restart.
My keep-alive file is created/updated when the script starts (very
important), and then updated once a minute. (In Phirehose terms, I use
the status.log as the keep-alive file, and update it in the
statusUpdate() callback.)
So, my minimum time between forcefully restarting the script is once
every 66 seconds. Two of those back to back is going to be very rare,
and if it happens it would almost certainly mean a network problems
somewhere (implying Twitter would never know about my repeated attempts
to connect).
My maximum time between some failure and trying the forced restart is 86
seconds. My application can cope with that much downtime, but if yours
cannot then you may need a more complicated solution.
Darren
--
Darren Cook, Software Researcher/Developer
http://dcook.org/work/ (About me and my work)
http://dcook.org/blogs.html (My blogs and articles)
The twitter docs mention following 50,000 people, so I don't think
you're hitting an API limit.
I skimmed the source and it is using POST for the data, so I don't think
you'd be hitting a limit there either.
I've had no content returned due to a bad character in my parameters.
(Though that may have been before an RFC encoding bug fix.)
The code is (phirehose.php, line 530):
$requestParams['follow'] = implode(',', $this->followIds);
So it trusts you have good data in your array. One idea is to convert
the array to integer, and see if you ended up with any zeroes or
negative numbers.
This line (in Phirehose.php) says what the request is that it has made:
$this->log('Connecting to twitter stream: ' . $url . ' with params: '
. str_replace("\n", '',var_export($requestParams, TRUE)));
Does it output anything unusual?