Replicator
public final class Replicator
A replicator for replicating document changes between a local database and a target database. The replicator can be bidirectional or either push or pull. The replicator can also be one-short or continuous. The replicator runs asynchronously, so observe the status property to be notified of progress.
-
Activity level of a replicator.
See moreDeclaration
Swift
public enum ActivityLevel : UInt8 -
Progress of a replicator. If
See moretotalis zero, the progress is indeterminate; otherwise, dividing the two will produce a fraction that can be used to draw a progress bar.Declaration
Swift
public struct Progress -
Combined activity level and progress of a replicator.
See moreDeclaration
Swift
public struct Status -
Initializes a replicator with the given configuration.
Declaration
Swift
public init(config: ReplicatorConfiguration) -
The replicator’s configuration.
Declaration
Swift
public var config: ReplicatorConfiguration -
The replicator’s current status: its activity level and progress. Observable.
Declaration
Swift
public var status: Status -
Starts the replicator. This method returns immediately; the replicator runs asynchronously and will report its progress throuh the replicator change notification.
Declaration
Swift
public func start() -
Stops a running replicator. This method returns immediately; when the replicator actually stops, the replicator will change its status’s activity level to
.stoppedand the replicator change notification will be notified accordingly.Declaration
Swift
public func stop() -
Adds a replicator change listener block. @param block The block to be executed when the change is received. @return An opaque object to act as the listener and for removing the listener when calling the removeChangeListener() method.
Declaration
Swift
public func addChangeListener(_ block: @escaping (ReplicatorChange) -> Void) -> NSObjectProtocol -
Removes a change listener. The given change listener is the opaque object returned by the addChangeListener() method. @param listener The listener object to be removed.
Declaration
Swift
public func removeChangeListener(_ listener: NSObjectProtocol)
Replicator Class Reference