CircuitParameters

public struct CircuitParameters<A>

Encapsulates properties needed to initialize a CircuitBreaker object within the RestRequest initializer. A is the type of the fallback’s parameter. See the CircuitBreaker documentation for a full explanation of these parameters.

  • The circuit timeout in milliseconds: defaults to 2000.

    Declaration

    Swift

    public let timeout: Int
  • The circuit timeout in milliseconds: defaults to 60000.

    Declaration

    Swift

    public let resetTimeout: Int
  • Max failures allowed: defaults to 5.

    Declaration

    Swift

    public let maxFailures: Int
  • Rolling Window in milliseconds: defaults to 10000.

    Declaration

    Swift

    public let rollingWindow: Int
  • Bulkhead: defaults to 0.

    Declaration

    Swift

    public let bulkhead: Int
  • The error fallback callback.

    Declaration

    Swift

    public let fallback: (BreakerError, A) -> Void
  • Initialize a CircuitParameters instance.

    Declaration

    Swift

    public init(name: String = "circuitName", timeout: Int = 2000, resetTimeout: Int = 60000, maxFailures: Int = 5, rollingWindow: Int = 10000, bulkhead: Int = 0, fallback: @escaping (BreakerError, A) -> Void)