ReplicationStatusDelegate

public protocol ReplicationStatusDelegate: class

Protocol for receiving Database Replication status events

  • Replication has completed, changes have been synced. If the replication is bi-directional then data transfer includes both sending and receiving.

    If this replication is repeating, then this method is called after each replication cycle.

    Non-repeating replication configuration is cleared after database(_: replicationDidComplete:) is called.

    Declaration

    Swift

    func database(_ database: Database, replicationDidComplete details: ReplicationDetails)

    Parameters

    database

    The replicating database

    details

    Configuration details for this replication

  • Replication is currently sending changes from the client to the server.

    This method may be called several times during the data transfer progress.

    Declaration

    Swift

    func database(_ database: Database, replicationIsSending details: ReplicationDetails, sent: Int, totalToSend: Int)

    Parameters

    database

    The replicating database

    details

    Configuration details for this replication

    sent

    The number of documents sent to the server in this replication cycle

    totalToSend

    An estimate of the total number of changes that will be sent in this replication cycle. This number may change during the replication process.

  • Replication is currently receiving changes from the server.

    This method may be called several times during the data transfer progress.

    Declaration

    Swift

    func database(_ database: Database, replicationIsReceiving details: ReplicationDetails, received: Int, totalToReceive: Int)

    Parameters

    database

    The replicating database

    details

    Configuration details for this replication

    received

    The number of documents received from the server in this replication cycle

    totalToReceive

    An estimate of the total number of changes that will be received in this replication cycle. This number may change during the replication process.

  • Replication encountered an error attempting the replication process.

    If this replication is repeating, the system will continue to attempt to replicate again automatically. Non-repeating replication configurations will not. In either case, database(_: replicationDidComplete:) will not be called after this method, as replication has not completed successfully.

    Declaration

    Swift

    func database(_ database: Database, replicationFailed details: ReplicationDetails, error: Error)

    Parameters

    database

    The replicating database

    details

    Configuration details for this replication

    error

    Error details about the replication failure