Latest 0.2.1
Homepage https://github.com/RestlessThinker/ShortCircuit
License MIT
Platforms osx 10.9, ios 8.0, watchos 2.0, tvos 9.0
Authors

Build Status

Circuit Breaker Pattern framework written in Swift

number5img

let number5 = ShortCircuitFactory.getNSUserDefaultsInstance()

if (number5.isAlive("testService")) {
  // make http request

  // upon success
  // number5.reportSucess("testService")
  // upon failure 
  // number5.reportFailure("testService")
} else {
  // service unavailable, do something else
}
id<CircuitBreaker> memoryCircuit = [ShortCircuitFactory getNSUserDefaultsInstance:20 retryTimeout:20];
  NSString *serviceName = @"testService";
  if ([memoryCircuit isAvailable:serviceName]) {

    // upon success
    // [memoryCircuit reportSuccess:serviceName];
    // upon failure
    // [memoryCircuit reportfailure:serviceName];

  } else {
    // service unavailable, do something else   
  }
}

Swift Server

A server implementation is in the works. Creating a Redis Adapter.

Latest podspec

{
    "name": "ShortCircuit",
    "version": "0.2.1",
    "summary": "Circuit Breaker Pattern framework written in Swift",
    "description": "Circuit Breaker Pattern framework written in Swift with multiple data source adapters for storage options for device and server",
    "homepage": "https://github.com/RestlessThinker/ShortCircuit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Louie Penaflor": "http://restlessthinker.com"
    },
    "social_media_url": "http://twitter.com/RestlessThinker",
    "platforms": {
        "osx": "10.9",
        "ios": "8.0",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "source": {
        "git": "https://github.com/RestlessThinker/ShortCircuit.git",
        "tag": "0.2.1"
    },
    "source_files": "ShortCircuit/*.swift"
}

Pin It on Pinterest

Share This