protoboard 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +16 -13
- data/lib/protoboard/circuit_breaker.rb +1 -1
- data/lib/protoboard/helpers/services_healthcheck_generator.rb +1 -1
- data/lib/protoboard/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e01a1ea9dda4c4cb8c9b89cfef74bb3d00431dad
|
4
|
+
data.tar.gz: d92e50f697b6a174de88956170951bbf7627a79a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57e78d10df3b84a5cce7320d6142515d4eb7bfd866479de0b0d6641e8092ade1c115b35ff50e10842a71d21ad095a8d758d149776488729c92b1fb872a56c6e5
|
7
|
+
data.tar.gz: 36aeb19a4a4fd7a61448a8236974bb65b8fadd00aedecb80bb821e911d70b4f3c6868538926147d9ad87f215da238bb5e63385a5b72223dd65fbfecaf069aa0b
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -30,11 +30,12 @@ class MyFooService
|
|
30
30
|
include Protoboard::CircuitBreaker
|
31
31
|
|
32
32
|
register_circuits [:some_method],
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
options: {
|
34
|
+
service: 'my_cool_service',
|
35
|
+
open_after: 2,
|
36
|
+
cool_off_after: 3
|
37
|
+
}
|
38
|
+
|
38
39
|
def some_method
|
39
40
|
# Something that can break
|
40
41
|
end
|
@@ -48,14 +49,14 @@ class MyFooService
|
|
48
49
|
include Protoboard::CircuitBreaker
|
49
50
|
|
50
51
|
register_circuits [:some_method],
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
52
|
+
fallback: -> (error) { 'Do Something' }
|
53
|
+
on_before: [->(ce) { Something.notify("Circuit #{ce.circuit.name}") }, ->(_) {}],
|
54
|
+
on_after: [->(ce) { Something.notify("It fails with #{ce.error}") if ce.fail? }],
|
55
|
+
options: {
|
56
|
+
service: 'my_cool_service',
|
57
|
+
open_after: 2,
|
58
|
+
cool_off_after: 3
|
59
|
+
}
|
59
60
|
def some_method
|
60
61
|
# Something that can break
|
61
62
|
end
|
@@ -119,6 +120,7 @@ In configuration you can customize the adapter options and set callbacks and con
|
|
119
120
|
|
120
121
|
Protoboard.configure do |config|
|
121
122
|
config.adapter = Protoboard::Adapters::StoplightAdapter
|
123
|
+
config.namespace = 'Foo'
|
122
124
|
|
123
125
|
config.adapter.configure do |adapter|
|
124
126
|
adapter.data_store = :redis # Default is :memory
|
@@ -136,6 +138,7 @@ end
|
|
136
138
|
The available options are:
|
137
139
|
|
138
140
|
* `adapter =` Sets the adapter, `Protoboard::Adapters::StoplightAdapter` is the default
|
141
|
+
* `namespace =` It's used to name the circuit avoiding naming colision with other projects
|
139
142
|
* `callbacks.before =` Receives an array of callables, lambdas, procs or any object that responds to `call` and receives one argument. It will be called before each circuit execution.
|
140
143
|
* `callbacks.after =` Receives an array of callables, lambdas, procs or any object that responds to `call` and receives one argument. It will be called after each circuit execution.
|
141
144
|
|
@@ -17,7 +17,7 @@ module Protoboard
|
|
17
17
|
# * +options+ - A hash containing the options needed for the circuit to execute
|
18
18
|
# * +:service+ - A string representing the name of the service for the circuit
|
19
19
|
# * +:open_after+ - An integer representing the number of errors to occur for the circuit to be opened
|
20
|
-
# * +:cool_off_after+ - An integer representing the
|
20
|
+
# * +:cool_off_after+ - An integer representing the time in seconds for the circuit to attempt to recover
|
21
21
|
#
|
22
22
|
# ==== Example
|
23
23
|
# options: {
|
data/lib/protoboard/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protoboard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Atkinson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-06-
|
12
|
+
date: 2018-06-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dry-configurable
|