semian 0.11.4 → 0.11.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/semian/resource.c +5 -2
- data/lib/semian/net_http.rb +6 -1
- data/lib/semian/version.rb +1 -1
- data/lib/semian.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0651ee42cbac47393177d1c80e6903e61dd226ce0da0adf57ee720c687bd2a0
|
4
|
+
data.tar.gz: 844843bbf8c005b4dae38529f2b51f16246c3c64b6e31e94648c3e4c3303f74c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c680195c4c8738df4bf06c71264f37a1a182dc680ae9186834872cac9ebd75949d5cc66ca839f199afbaf1cbf45c11d65d76b34a27717dbbd85962be23594753
|
7
|
+
data.tar.gz: e630c03e61c1224661cae64c6ebcaf0e5a706ae08262fa4659054519216c849a6de5b2777ca4069e76a5e87bad2c740125e10138e58034e2d734b16e52f481cc
|
data/ext/semian/resource.c
CHANGED
@@ -272,8 +272,11 @@ check_permissions_arg(VALUE permissions)
|
|
272
272
|
static void
|
273
273
|
check_tickets_xor_quota_arg(VALUE tickets, VALUE quota)
|
274
274
|
{
|
275
|
-
if (
|
276
|
-
rb_raise(rb_eArgError, "
|
275
|
+
if (tickets == Qnil && quota == Qnil) {
|
276
|
+
rb_raise(rb_eArgError, "Semian configuration require either the :ticket or :quota parameter, you provided neither");
|
277
|
+
}
|
278
|
+
if (tickets != Qnil && quota != Qnil) {
|
279
|
+
rb_raise(rb_eArgError, "Semian configuration require either the :ticket or :quota parameter, you provided both");
|
277
280
|
}
|
278
281
|
}
|
279
282
|
|
data/lib/semian/net_http.rb
CHANGED
@@ -61,6 +61,11 @@ module Semian
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
+
def initialize(*args, semian: true)
|
65
|
+
super(*args)
|
66
|
+
@semian_enabled = semian
|
67
|
+
end
|
68
|
+
|
64
69
|
Semian::NetHTTP.reset_exceptions
|
65
70
|
|
66
71
|
def raw_semian_options
|
@@ -75,7 +80,7 @@ module Semian
|
|
75
80
|
end
|
76
81
|
|
77
82
|
def disabled?
|
78
|
-
raw_semian_options.nil?
|
83
|
+
raw_semian_options.nil? || @semian_enabled == false
|
79
84
|
end
|
80
85
|
|
81
86
|
def connect
|
data/lib/semian/version.rb
CHANGED
data/lib/semian.rb
CHANGED
@@ -46,7 +46,7 @@ require 'semian/lru_hash'
|
|
46
46
|
# resource the time to recover. If `error_threshold` errors happen in the span of `error_timeout`
|
47
47
|
# then the circuit will be opened and every attempt to acquire the resource will immediately fail.
|
48
48
|
#
|
49
|
-
# Once in open state, after `error_timeout` is elapsed, the
|
49
|
+
# Once in open state, after `error_timeout` is elapsed, the circuit will transition in the half-open state.
|
50
50
|
# In that state a single error will fully re-open the circuit, and the circuit will transition back to the closed
|
51
51
|
# state only after the resource is acquired `success_threshold` consecutive times.
|
52
52
|
#
|
@@ -62,7 +62,7 @@ require 'semian/lru_hash'
|
|
62
62
|
#
|
63
63
|
# After 3 failures in the span of 10 seconds the circuit will be open.
|
64
64
|
# After an additional 10 seconds it will transition to half-open.
|
65
|
-
# And finally after 2
|
65
|
+
# And finally after 2 successful acquisitions of the resource it will transition back to the closed state.
|
66
66
|
#
|
67
67
|
# ===== Using a resource
|
68
68
|
#
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semian
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Francis
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-11-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake-compiler
|
@@ -251,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
251
251
|
- !ruby/object:Gem::Version
|
252
252
|
version: '0'
|
253
253
|
requirements: []
|
254
|
-
rubygems_version: 3.
|
254
|
+
rubygems_version: 3.2.20
|
255
255
|
signing_key:
|
256
256
|
specification_version: 4
|
257
257
|
summary: Bulkheading for Ruby with SysV semaphores
|