Uploaded image for project: 'Realm Kotlin'
  1. Realm Kotlin
  2. RKOTLIN-299

SyncSession - ProgressListeners

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sync
    • None

      Implement relevant progress listener API's similar to Realm Java

       

       

      enum class ProgressMode {
        CURRENT_CHANGES,
        INDEFINETELY
      }
      
      data class Progress(val transferredBytes: Long, val transferableBytes: Long) {
        val fractionTransferred: Double
        val transferComplete: Boolean
      }
      typealias ProgressListener = (progress: Progress) -> Unit
      
      class SyncSession {
        fun addDownloadProgressListener(mode: ProgressMode, listener: ProgressListener): Cancellable 
       fun addUploadProgressListener(mode: ProgressMode, listener: ProgressListener): Cancellable
        fun uploadAllLocalChanges(timeout: Long = Long.MAX_VALUE, unit = TimeUnit.SECONDS)  
       fun downloadAllServerChanges(timeout: Long = Long.MAX_VALUE, unit = TimeUnit.SECONDS) 
      }

       

       

            Assignee:
            claus.rorbech@mongodb.com Claus Rørbech (Inactive)
            Reporter:
            christian.melchior@mongodb.com Christian Melchior (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: