daleharvey/jquery.couch.js — pull request #9 by radicand (2012-04-10 23:38:20+00:00)
Title: Close HTTP connection when we call .stop() on a live _changes feed

Right now, calling stop() on a _changes feed only prevents it from renewing itself when an update comes through and never closes until we navigate away from the page or an update does happen (and as noted, it won't renew).

For long-lived pages, this becomes an issue, as many open HTTP connections can begin to build up and (in some instances) prevent further calls to Couch until the open connections are closed. This is the reason behind this bugfix.

It is possible that some people may open _changes, call stop() and then rely on that behavior to return only one update-- but this is bad practice in general and easy to adjust for; versus calls to Couch stopping to work altogether.