cloudant/fabric — pull request #87 by kocolosk (2013-04-26 15:13:19+00:00)
Title: Report progress as filters supress documents

The intent of this PR is to ensure that sequences delivered via the `_changes` feed are incremented as the filter analyzes and rejects documents. Previously the only time the client would receive information about the work accomplished by a filter on a given shard worker was when a document successfully passed the filter. Now the client receives that information when a doc on _any_ shard passes the filter, or when the entire database has been analyzed and we deliver a `last_seq` entry in the feed.

There is a side effect of this patch. Previously we had been using a simple `after` clause in a `receive` statement to issue heartbeats if we did not receive a message from any worker for a period of time. With this patch we receive messages that we do not forward to the HTTP client, so we need a new tracking measure to decide when to send heartbeats. The solution here simply issues a heartbeat to client every N seconds regardless of whether we've sent rows to the client in the interim.

This PR is an alternative to #80, which used a different and more complicated tracking approach for issuing heartbeats. #80 also incorporated a switch to the new streaming capabilities in rexi, which I think are very useful but outside the scope of this particular bugfix.

BugzID: 17709