Strategy

@objc
public enum Strategy : Int

Strategy to choose between online and offline search.

  • Search online only. The search will fail when the API can’t be reached.

    Note

    You might consider that this defeats the purpose of having a mirror in the first place… But this is intended for applications wanting to manually manage their policy.

    Declaration

    Swift

    case onlineOnly = 0
  • Search offline only. The search will fail when the offline mirror has not yet been synced.

    Declaration

    Swift

    case offlineOnly = 1
  • Search online, then fallback to offline on failure. Please note that when online, this is likely to hit the request timeout on every host before failing.

    Declaration

    Swift

    case fallbackOnFailure = 2
  • Fallback after a certain timeout. Will first try an online request, but fallback to offline in case of failure or when a timeout has been reached, whichever comes first.

    The timeout can be set through the offlineFallbackTimeout property.

    Declaration

    Swift

    case fallbackOnTimeout = 3