SwiftyGuerrero / CircuitBreakerTime

The demo for the Swift Cloud Workshop 3 talk on Circuit Breakers with Swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CircuitBreakerTime

The demo for the Swift Cloud Workshop 3 talk on Circuit Breakers with Swift

Swift 4.0 DUB platform standard-readme compliant

Table of Contents

Background

This is final demo for the Swift Cloud Workshop 3 talk on Circuit Breakers with Swift. This demo contains a webserver that demonstrates how to use two different versions of a circuit breaker. They are a light weight implementation called SGCircuitBreaker and IBM-Swift's Circuit Breaker.

Requirements

  • Swift 4.0 and greater
  • macOS: 10.9 and greater
  • Linux
  • Make build utility
  • Docker

Install

Repo setup

In a terminal, you can clone the repo like so:

$ git clone git@github.com:eman6576/CircuitBreakerTime.git

then change into the directory like so:

$ cd CircuitBreakerTime

Build project

To build the project and open it in Xcode, you can enter this command:

$ make all

To reset the build directories and rebuild, you can use:

$ make clean_all

Usage

Running The Server

The webserver can run on both macOS and Linux.

To run the webserver in macOS, use:

$ make run_local

To run the webserver in Linux using Docker, use:

$ make run_linux

Endpoints

The base url of the webserver is http://localhost:8090. There are five endpoints that you can access:

These endpoints use an instance of SGCircuitBreaker.

  • /swiftyguerrero
    • GET /success: Simulates a successful operation and notifies the client that it was intially successful.
    • GET /success-delay: Simulates a operation that timesout the first time and then succeds the second time.
    • GET /failure: Simulates a operation that failed and that would trip the circuit.

These endpoints use an instance of IBM-Swift's CircuitBreaker.

  • /ibm
    • GET /success: Simulates a successful operation and notifies the client that it was intially successful.
    • GET /failure: Simulates a operation that failed and that would trip the circuit.

Maintainers

Manny Guerrero Twitter Follow GitHub followers

License

MIT © Manny Guerrero.

About

The demo for the Swift Cloud Workshop 3 talk on Circuit Breakers with Swift

License:MIT License


Languages

Language:Swift 91.8%Language:Makefile 8.2%