addDocumentReplicationListener abstract method
Adds a listener
to be notified of DocumentReplications performed by
this replicator.
Because of performance optimization in the replicator, document replications need to be listened to before starting the replicator. If the listener is added after the replicator is started, the replicator needs to be stopped and restarted again to ensure that the listener will get the document replication events.
Adding a listener
If a Future is returned, the listener will only start listening after the Future has completed. Otherwise the listener is listening immediately after this method returns.
Removing a listener
The returned ListenerToken needs to be provided to removeChangeListener, to remove the given listener. Regardless of whether a Future is returned or not, the listener immediately stops being called.
See also:
- DocumentReplication for the change event given to
listener
. - addChangeListener for listening for changes to the status this replicator.
- removeChangeListener for removing a previously added listener.
Implementation
FutureOr<ListenerToken> addDocumentReplicationListener(
DocumentReplicationListener listener,
);