TDReplicator never calls notifyObservers() #62

merged 1 commit into from Aug 3, 2012

2 participants


I'm observing TDReplicator to determine when async replication is complete and to get an idea of replication progress, but the update() method of my Observer class is never called. The intent to use the Observable/Observer pattern is there -- TDReplicator.setChangesTotal() and setChangesProcessed() call notifyObservers(), but nothing calls them. Instead, TDPuller and TDPusher modify the changesTotal and changesProcessed member variables directly.

In this pull request, I have made changesTotal and changesProcessed private and have updated TDPuller and TDPusher to use the setter methods any time the number of changes, er, changes. As a result, my observer is being called as expected.

@pegli pegli make changesProcessed and changesTotal private and change TDPusher an…
…d TDPuller to use the access methods. This ensures that Observers get called with replication changes.
@mschoch mschoch merged commit 12754b8 into couchbaselabs:master Aug 3, 2012
couchbaselabs member

Thanks for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment