Open carlosduclos opened 7 years ago
CouchDB developers in their infinite wisdom handle requests to "_replicator" differently from requests to "_replicate".
While requests to "_replicate" replied with a full response, requests to "_replicator" reply with a partial response and need to be polled until the replication is done. Working on implementing that.
After a few tries, I came to the conclusion that this requires at least two different methods. The reason is that replication will be scheduled after a write to "_replicator" and couchdb will handle the status internally. At some point in time the replication will finish (either successfully or with error), but there is no way to know when.
The idea behind this is to allow for a fully asynchronous API that can monitor the status of the replication without having to wait on it. This is especially important in large replication where the time involved in replication might be measured in several minutes, hours or even days!
So I have come up with three methods:
Sent pull request #350
According to http://guide.couchdb.org/draft/replication.html (and own testing), writing a replication document to "_replicate" will enable replication only for the current server session, but after a server restart it will not enable it again.
Relates to #290