 import Foundation
 
 @objc
-public protocol CircuitBreakerProtocol {
+public protocol CircuitBreaker {
     func isAvailable (serviceName: String) -> Bool
     func reportFailure (serviceName: String) -> Void
     func reportSuccess (serviceName: String) -> Void

}

@objc
class BaseAdapter : NSObject, CircuitBreakerStorageProtocol {
 
    /**
     how long the stats array should persist in cache

@objc
public class ShortCircuitFactory : NSObject {
  
  public static func getInMemoryInstance(maxFailures:Int = 20, retryTimeout:Int = 20) -> CircuitBreaker {
    let storage = MemoryAdapter()
    return ShortCircuit(storage: storage, maxFailures: maxFailures, retryTimeout: retryTimeout)
  }
  
  public static func getNSUserDefaultsInstance(maxFailures:Int = 20, retryTimeout:Int = 20) -> CircuitBreaker {
    let storage = NSUserDefaultsAdapter()
    return ShortCircuit(storage: storage, maxFailures: maxFailures, retryTimeout: retryTimeout)
  }
}

@objc
public class ShortCircuit : NSObject, CircuitBreaker {
    
    var storageAdapter:CircuitBreakerStorage
    
    var defaultMaxFailures:Int
    
