Hello,<div><br></div><div>I am trying to implement a continuous polling client for couchdb change notifications, which uses HTTP protocol (REST):</div><div><br></div><div><a href="http://guide.couchdb.org/draft/notifications.html">http://guide.couchdb.org/draft/notifications.html</a></div>

<div><br></div><div>I have started by using the agent described here: <a href="http://twistedmatrix.com/documents/current/web/howto/client.html">http://twistedmatrix.com/documents/current/web/howto/client.html</a></div><div>

<br></div><div>This is working fine, but the problem is that the connection is not permanent: it is being closed after a timeout (I think 1 minute).</div><div>For continuous polling, I need to keep the connection open (forever), or if that is not possible, to reconnect as soon as the connection is closed.</div>

<div><br></div><div>I have taken a look at the code, and the problem seems to be that the Agent (twisted/web/client.py) class is using ClientCreator (twisted/internet/protocol.py)</div><div>ClientCreator is not doing reconnection. I would like to implement a similar class to ClientCreator, but one which uses ReconnectingClientFactory (twisted/internet/protocol.py)</div>

<div><br></div><div>I have not found any guidance in using ReconnectingClientFactory. According to the documentation:</div><div><br></div><div><div>&quot;Note that clients should call my resetDelay method after they have connected successfully.&quot;</div>

</div><div><br></div><div>The difficulty I have is that the factory is not returning any deferred which I could use to catch when connections are established, and then call the resetDelay method.</div><div><br></div><div>

Do you have any pointers to examples of use of ReconnectingClientFactory?</div><div><br></div><div>BR,</div><div>Daniel Gonzalez</div><div><br></div>