• Stars
    star
    175
  • Rank 210,332 (Top 5 %)
  • Language
    Erlang
  • License
    Apache License 2.0
  • Created about 10 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

💥 An Erlang library for breaking out of faulty services

Build Status

Generic circuit breaker that can be used to break any service that isn't fully functional. A service can be manually blocked/cleared as well.

See doc/overview.edoc for more info.

Building

rebar3 compile
rebar3 doc
rebar3 eunit

Using

%% Circuit-breaking
call(State, SomeId) ->
    circuit_breaker:call(
        % service identifier for the circuit
        {myservice, SomeId},

        % function being monitored
        fun() -> some_call(State) end,

        % call timeout
        timer:minutes(1),

        % reset fun, just returns true
        fun() -> true end,

        % timeout before reset in case of break
        timer:minutes(5),

        %% Options
        [
            % Number of errors tolerated per unit of time.
            {n_error, 3},
            {time_error, timer:minutes(30)},

            %% number of calls returning 'timeout' tolerated in a given
            %% period of time.
            {n_timeout, 3},
            % interval to happen
            {time_timeout, timer:minutes(30)},

            %% number of calls not responding in due time tolerated, and
            %% the time interval for the N failures to happen
            {n_call_timeout, 3},
            {time_call_timeout, timer:minutes(25)},

            %% When failing, the {'EXIT', Reason} tuple will be returned from
            %% the call. This list of `Reason's allows to avoid counting specific
            %% errors towards thresholds that can break a circuit.
            {ignore_errors, []}
        ]
    ).

More Repositories

1

electron-redux

Use redux in the main and browser processes in electron
JavaScript
738
star
2

ui

[Archived] 🔩 Klarna's UI components library
JavaScript
208
star
3

ponos

ponos is a simple yet powerful load generator written in erlang
Erlang
157
star
4

mnesia_eleveldb

An eleveldb backend for Mnesia
Erlang
151
star
5

jesse

This repository is no longer actively maintained, please see
Erlang
136
star
6

erlavro

Avro support for Erlang/Elixir (http://avro.apache.org/)
Erlang
129
star
7

higher-order-components

A collection of useful React higher-order components
JavaScript
127
star
8

system_monitor

BEAM VM telemetry collector
Erlang
68
star
9

bec

The BitBucket Erlang Client
Erlang
46
star
10

snabbkaffe

Collection of utilities for trace-based testing
Erlang
45
star
11

brucke

Brucke - Inter-cluster bridge of kafka topics
Erlang
43
star
12

katt

This repository is no longer actively maintained, please see
Erlang
42
star
13

product-page-dataset

42
star
14

mnesia_pg

Postgres backend to Mnesia via mnesia_ext
Erlang
40
star
15

kco-mobile-sdk

[Deprecated] Klarna Checkout SDK for mobile apps in iOS and Android
HTML
38
star
16

kco_php

DEPRECATED: Klarna Checkout PHP library
PHP
33
star
17

leveldb_manager

Small service for snapshotting eleveldb without stopping the Erlang node
Erlang
32
star
18

kco_rest_php

[DEPRECATED] Official PHP SDK library for Klarna Services
PHP
31
star
19

remote-frames

Render a subset of the React tree to a different location, from many locations, without having to coordinate them
JavaScript
27
star
20

kastle

Kafka REST proxy
Erlang
27
star
21

klarna-mobile-sdk

Klarna Mobile SDK for iOS & Android
Objective-C
25
star
22

kco_rest_java

[DEPRECATED] Official Java SDK library for Klarna Services
Java
24
star
23

react-native-klarna-inapp-sdk

Klarna's React Native wrapper for the In-App SDK
Kotlin
22
star
24

react-native-zlib

Inflate/Deflate data compression via native code.
Java
20
star
25

geofences-reducer

Reduces overlapping geofences
TypeScript
20
star
26

kco_rest_dotnet

[DEPRECATED] Official .NET.Core SDK library for Klarna Services
C#
20
star
27

avlizer

Avro Data Serializer for Erlang
Erlang
19
star
28

lager_middleman_backend

Erlang
18
star
29

soapbox

RIP: XMLRPCful microframework.
16
star
30

disable-scroll

Fix the screen to the current position and get a canvas where to draw on top of it
JavaScript
15
star
31

ui-react-components

Klarna's UI React Components
JavaScript
15
star
32

vnet

A model of a distributed Erlang network within a single VM.
Erlang
14
star
33

krc

RIP: The K Riak Client.
13
star
34

kco_python

Klarna Checkout Python Library
Python
13
star
35

erl_unused_includes

Shell
11
star
36

klarna-mobile-sdk-flutter

Klarna's Flutter wrapper plugin for the Klarna Mobile SDK
Kotlin
10
star
37

hubot-stash-poll

Poll your Atlassian Stash repositories for pull request changes
CoffeeScript
10
star
38

klarna-on-demand-ios

Klarna On Demand SDK for iOS
Objective-C
10
star
39

kp-android-example-app

An example Android app to demonstrate Klarna Mobile SDK for Klarna Payments usage https://github.com/klarna/klarna-mobile-sdk
Kotlin
9
star
40

ui-css-components

Klarna's UI CSS Components
CSS
9
star
41

php-xmlrpc

DEPRECATED: the klarna xmlrpc library for php
PHP
9
star
42

graphite-erlang

A dead-simple graphite metrics writer for Erlang
Erlang
9
star
43

klarna-on-demand-android

Klarna On Demand SDK for Android
Java
8
star
44

kco_dotnet

DEPRECATED: Klarna Checkout dotnet library
C#
8
star
45

rimu

RIP: Riak implementations of MeshUp interfaces.
Erlang
8
star
46

cloud9-gradle-template

Template workspace structure for a Java Gradle project in Cloud9
Java
7
star
47

katt-js

KATT (Klarna API Testing Tool) is an HTTP-based testing tool for Node.
CoffeeScript
7
star
48

op5-cli

A command-line interface for the OP5 monitoring system
Python
7
star
49

day.zip

Shell
6
star
50

op5lib

A Python library for OP5's REST API.
Python
6
star
51

kco_java

DEPRECATED:Klarna Checkout Java Library
Java
6
star
52

smoooth-tutorials

Repository hosting all code examples for the Klarna Smoooth Tutorials
JavaScript
6
star
53

klarna.github.io

HTML
5
star
54

stdapp.mk

Generic Makefile for building Erlang applications
Makefile
5
star
55

sample-digital-goods-backend

A sample integration of Klarna's Digital Goods
Ruby
5
star
56

browser

☔ "It is best to act with confidence, no matter how little right you have to it." Lillian Hellman
JavaScript
5
star
57

kp-ios-example-app

An example iOS app to demonstrate Klarna Mobile SDK for Klarna Payments usage
Swift
4
star
58

ansible-role-import-and-trust-certificate

Ansible role for importing and trusting PEM certificates.
4
star
59

on-demand-for-digital-goods-docs

4
star
60

op5lib_ansible

Python
4
star
61

cloudconfig

Cloudconfig is an application that manages configurations for resources in Cloudstack.
Ruby
4
star
62

restit

REST Interface Tool is a prototype for consuming pure REST APIs.
CoffeeScript
4
star
63

hybrid-android-example-app

Kotlin
3
star
64

m2-kco-postnl

Magento 2.x Add-On module to add support for PostNL to Klarna Checkout
JavaScript
3
star
65

katt-util

KATT utilities for KATT blueprints.
CoffeeScript
2
star
66

sample-ondemand-backend

A very slim backend that facilitates purchases for an app using the Klarna on Demand SDK.
Ruby
2
star
67

klarna-apigen-theme

Klarna ApiGen Theme
HTML
2
star
68

m1-klarna-payments

Magento 1.x Klarna Payments plugin
PHP
2
star
69

kco_asp

Klarna Checkout ASP Library
ASP
2
star
70

kco-android-example-app

An example Android app to demonstrate Klarna Checkout SDK usage
Java
2
star
71

kp-mobile-sdk

Klarna Payments SDK for mobile apps in iOS and Android
2
star
72

ui-workshop

Konferense 2016 - UI Components workshop
JavaScript
2
star
73

katt-player

KATT player is a mock HTTP server that replies with HTTP responses based on KATT blueprints.
CoffeeScript
2
star
74

m1-klarna-checkout

Magento 1.x Klarna Checkout plugin
PHP
1
star
75

kco-ios-example-app

An example iOS app to demonstrate Klarna Checkout SDK usage
Objective-C
1
star
76

m1-kp-altaddress

Magento 1.x Sample Add-On module to add support for EMD to Klarna Payments
PHP
1
star
77

nordicjs

A code challenge and short presentation to show at nordic.js
CSS
1
star
78

klarna-on-demand-integration-tests

Contains common integration tests for Klarna's on Demand SDKs
Ruby
1
star
79

ansible-role-homebrew

Ansible role for installing Homebrew and Homebrew Cask.
1
star
80

KlarnaMobileSDKDemo

Klarna Mobile SDK demo app for iOS
Swift
1
star
81

kco-cordova-example-app

An example Cordova app to demonstrate Klarna Checkout SDK usage
Java
1
star
82

swedish_personal_number

A Value Object that provides some convenience helpers to deal with Swedish personal numbers
Ruby
1
star
83

ui-prototype

A base for prototyping
JavaScript
1
star
84

passkeyring

Python
1
star
85

on-demand-for-digital-goods-python

On demand for digital goods. Simple example in Python
Python
1
star
86

gradle-react-native

Gradle Plugin for Building React Native projects
Kotlin
1
star
87

m1-kco-altaddress

Magento 1.x Sample Add-On module to add support for EMD to Klarna Checkout
PHP
1
star
88

ipx-mock

A mock for IPX SMS Service
Ruby
1
star
89

omniauth-klarna

This is the official OmniAuth strategy to authenticate with Klarna via OAuth2.
Ruby
1
star