semian 0.25.5 → 0.26.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/semian/configuration_validator.rb +0 -6
- data/lib/semian/version.rb +1 -1
- data/lib/semian.rb +19 -6
- metadata +16 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c745b1aaf79e752138bf6cbfcff3e218022dfbaac8b3f6adba3dd9bd4091bbee
|
|
4
|
+
data.tar.gz: 03e8d192ffd5e7b86aadb3b87ad9846e4d0cc18724d67a14e72c35949a11e3f6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: afa858cd11acdf8047f6dd38850419927915ff87b6dfeabd820ffa888b269aafc67415cce0a85543e3d49562b733a01ea8b22fd46c6b5fc24374236a333cf0ef
|
|
7
|
+
data.tar.gz: 9a087827f9abaefa6bdcdda853b3423e9a19fe9e0b6a35c2cea8650266857713ffeea39136560a6ed1f763940ff9f28868bcbb9e95aa84cac91764229cb2dfdb
|
|
@@ -7,12 +7,6 @@ module Semian
|
|
|
7
7
|
@configuration = configuration
|
|
8
8
|
@adapter = configuration[:adapter]
|
|
9
9
|
@force_config_validation = force_config_validation?
|
|
10
|
-
|
|
11
|
-
unless @force_config_validation
|
|
12
|
-
Semian.logger.info(
|
|
13
|
-
"Semian Resource #{@name} is running in log-mode for configuration validation. This means that Semian will not raise an error if the configuration is invalid. This is not recommended for production environments.\n\n[IMPORTANT] PLEASE UPDATE YOUR CONFIGURATION TO USE `force_config_validation: true` TO ENABLE STRICT CONFIGURATION VALIDATION.\n---\n",
|
|
14
|
-
)
|
|
15
|
-
end
|
|
16
10
|
end
|
|
17
11
|
|
|
18
12
|
def validate!
|
data/lib/semian/version.rb
CHANGED
data/lib/semian.rb
CHANGED
|
@@ -104,7 +104,7 @@ module Semian
|
|
|
104
104
|
OpenCircuitError = Class.new(BaseError)
|
|
105
105
|
SemaphoreMissingError = Class.new(BaseError)
|
|
106
106
|
|
|
107
|
-
attr_accessor :maximum_lru_size, :minimum_lru_time, :default_permissions, :namespace, :default_force_config_validation
|
|
107
|
+
attr_accessor :maximum_lru_size, :minimum_lru_time, :default_permissions, :namespace, :default_force_config_validation
|
|
108
108
|
|
|
109
109
|
self.maximum_lru_size = 500
|
|
110
110
|
self.minimum_lru_time = 300 # 300 seconds / 5 minutes
|
|
@@ -123,9 +123,6 @@ module Semian
|
|
|
123
123
|
@thread_safe = thread_safe
|
|
124
124
|
end
|
|
125
125
|
|
|
126
|
-
self.resources = LRUHash.new
|
|
127
|
-
self.consumers = Concurrent::Map.new
|
|
128
|
-
|
|
129
126
|
@reset_mutex = Mutex.new
|
|
130
127
|
|
|
131
128
|
def issue_disabled_semaphores_warning
|
|
@@ -265,8 +262,8 @@ module Semian
|
|
|
265
262
|
|
|
266
263
|
def reset!
|
|
267
264
|
@reset_mutex.synchronize do
|
|
268
|
-
|
|
269
|
-
|
|
265
|
+
@consumers = Concurrent::Map.new
|
|
266
|
+
@resources = LRUHash.new
|
|
270
267
|
end
|
|
271
268
|
end
|
|
272
269
|
|
|
@@ -285,6 +282,22 @@ module Semian
|
|
|
285
282
|
thread.thread_variable_set(THREAD_BULKHEAD_DISABLED_VAR, old_value)
|
|
286
283
|
end
|
|
287
284
|
|
|
285
|
+
def resources
|
|
286
|
+
return @resources if defined?(@resources) && @resources
|
|
287
|
+
|
|
288
|
+
@reset_mutex.synchronize do
|
|
289
|
+
@resources ||= LRUHash.new
|
|
290
|
+
end
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
def consumers
|
|
294
|
+
return @consumers if defined?(@consumers) && @consumers
|
|
295
|
+
|
|
296
|
+
@reset_mutex.synchronize do
|
|
297
|
+
@consumers ||= Concurrent::Map.new
|
|
298
|
+
end
|
|
299
|
+
end
|
|
300
|
+
|
|
288
301
|
private
|
|
289
302
|
|
|
290
303
|
def create_circuit_breaker(name, **options)
|
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.
|
|
4
|
+
version: 0.26.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Scott Francis
|
|
@@ -10,7 +10,21 @@ authors:
|
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
12
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
13
|
-
dependencies:
|
|
13
|
+
dependencies:
|
|
14
|
+
- !ruby/object:Gem::Dependency
|
|
15
|
+
name: concurrent-ruby
|
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
|
17
|
+
requirements:
|
|
18
|
+
- - ">="
|
|
19
|
+
- !ruby/object:Gem::Version
|
|
20
|
+
version: '0'
|
|
21
|
+
type: :runtime
|
|
22
|
+
prerelease: false
|
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
24
|
+
requirements:
|
|
25
|
+
- - ">="
|
|
26
|
+
- !ruby/object:Gem::Version
|
|
27
|
+
version: '0'
|
|
14
28
|
description: |2
|
|
15
29
|
A Ruby C extention that is used to control access to shared resources
|
|
16
30
|
across process boundaries with SysV semaphores.
|