Hi,<br><br>A couple of people recently asked about support for persistent connections, after a bit of hacking around I&#39;ve uploaded an update which has basic persistent connection support: <a href="https://github.com/BraveSirRobin/amqphp" target="_blank">https://github.com/BraveSirRobin/amqphp</a> (check the 0.9.1 tag)<br>


<br><br>The implementation turned out to be fairly straightforward, I only had to add the STREAM_CLIENT_PERSIST flag to the existing stream_socket_client() call, so the changes weren&#39;t too invasive.� I&#39;ve created a new &quot;Connection&quot; object called PConnection, and set up a simple framework to persist amqp connection parameters between web requests.� The amqp connection setup process is only run the first time the PConnection is opened, so both the Amqp &quot;session&quot; and TCP connection remain after the web request and are re-used by subsequent requests to that process.� My plan is to add support for persisting Channels as well, possibly by having API calls use channel.flow to inform the broker during the web request wakeup / sleep routines.<br>


<br>I&#39;d be interested to hear what the RabbitMQ people think about the likely behavior of PHP &quot;persistent connections&quot;, which may include:<br><br>�* If the web server is restarted, all open client connections are dropped without going through the amqp shutdown 
sequence, so you get lots of &quot;closed abruptly&quot; errors in the log.<br>�* If a web server has no web requests to process then the persistent client can&#39;t respond to any messages the broker sends; the client will &quot;go quiet&quot;.<br>

<br>In case you don&#39;t know what PHP persistent connections are, they&#39;re basically a socket re-use method for web servers, the idea is that the socket remains open between web requests in order to avoid TCP setup / teardown overheads on busy sites.<br>
<br>If you&#39;d like to test this then check out the demo-multi-producer.php script, I&#39;ve run this inside a PHP-FPM / Nginx setup and it seems to work fine.<br><br>Thanks,<br>--Robin<br>