InstanceDiscoverCallback Protocol

This callback is used by some methods to inform the app about the progress of a long lasting process, such as determining smart locations, performing a ping or speedtest.

The app might update the UI, e.g. updating location latency values while a ping test is running.

This protocol only defines one method and the progress_type parameter indicates what type of progress information it contains.

public protocol InstanceDiscoveryCallbackTrait : AnyObject {
    func progress(progressType: ProgressType)  -> Bool
}

public enum ProgressType {   
    case ping(pingResult: TestResult)
    case speedTestInstanceSelected(pingRating: ClusterPingRatingResult)
    case speedTestDownload(currentBandwidthMegabitPerSec: Float, recommendedScaleMaxMegabitPerSec: UInt32)
    case speedTestUpload(currentBandwidthMegabitPerSec: Float, recommendedScaleMaxMegabitPerSec: UInt32)
}

Last updated