istox 0.2.20.2 → 0.3.2
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/istox/helpers/grpc_client.rb +8 -3
- data/lib/istox/helpers/gruf_listener_hook.rb +7 -7
- data/lib/istox/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f204c5ffdfb9a40f6c2321cc863af4be2d859daabd265c4e38ef77f5a253ae3
|
4
|
+
data.tar.gz: ccd9b724f91399670ed6cc8ff583cc458ebf40bec8d4e524b20fe8ef5b7aa1b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9858a1c492f1e12a4e4c32a2e36982d333a2e504ada7ce25e3724335855a244f525a2d75dea733aad6940267d659e82bfc3b12f2afaa3acb638b0b22ab5cc63f
|
7
|
+
data.tar.gz: 236e8870b856d0c89b315b4ce67c5b8a20c7c89e2135987878a9e85f144517074851040a41f295766defc3fb9ab83ce720cc1e3812a362c41684e35330063618
|
@@ -3,10 +3,12 @@ require 'istox/helpers/logger'
|
|
3
3
|
module Istox
|
4
4
|
class GrpcClient
|
5
5
|
class << self
|
6
|
-
def add_host(host_type, url)
|
6
|
+
def add_host(host_type, url, cert: nil)
|
7
7
|
@@hosts = {} unless defined?(@@hosts)
|
8
|
+
@@certs = {} unless defined?(@@certs)
|
8
9
|
|
9
10
|
@@hosts[host_type] = url
|
11
|
+
@@certs[host_type] = cert
|
10
12
|
end
|
11
13
|
|
12
14
|
def add_interceptors(interceptor)
|
@@ -16,7 +18,7 @@ module Istox
|
|
16
18
|
end
|
17
19
|
|
18
20
|
def configure_grpc_logger
|
19
|
-
|
21
|
+
Gruf.grpc_logger = log
|
20
22
|
end
|
21
23
|
|
22
24
|
def call(host_type, service, method, grpc_retries_count: 1, **keyword_args)
|
@@ -78,11 +80,14 @@ module Istox
|
|
78
80
|
@@services = {} unless defined?(@@services)
|
79
81
|
|
80
82
|
host_url = @@hosts[host_type]
|
83
|
+
cert_path = @@certs[host_type]
|
81
84
|
raise StandardError, 'Unable to find host, have you forgotten to add host to grpc client?' unless host_url
|
82
85
|
|
83
86
|
log.info 'Reinitiating to grpc host at ' + host_url
|
84
87
|
t1 = Time.now
|
85
|
-
@@services[get_key(host_type, service)] = ::Gruf::Client.new(service: service,
|
88
|
+
@@services[get_key(host_type, service)] = ::Gruf::Client.new(service: service,
|
89
|
+
options: { hostname: host_url, ssl_certificate_file: cert_path },
|
90
|
+
client_options: client_options)
|
86
91
|
log.info "Time taken for reinitiating grpc host: #{Time.now - t1} seconds"
|
87
92
|
end
|
88
93
|
|
@@ -3,14 +3,14 @@ module Istox
|
|
3
3
|
def before_server_start(server:)
|
4
4
|
# do my thing before the server starts
|
5
5
|
|
6
|
-
@listener = ::Listen.to('app/rpc') do |modified, added, removed|
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
# @listener = ::Listen.to('app/rpc') do |modified, added, removed|
|
7
|
+
# puts "modified absolute path: #{modified}"
|
8
|
+
# puts "added absolute path: #{added}"
|
9
|
+
# puts "removed absolute path: #{removed}"
|
10
10
|
|
11
|
-
|
12
|
-
end
|
13
|
-
@listener.start # not blocking
|
11
|
+
# server.init_restart
|
12
|
+
# end
|
13
|
+
# @listener.start # not blocking
|
14
14
|
end
|
15
15
|
|
16
16
|
def after_server_stop(server:)
|
data/lib/istox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: istox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Siong Leng
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: amazing_print
|
@@ -519,7 +519,7 @@ files:
|
|
519
519
|
homepage: http://www.abc.com
|
520
520
|
licenses: []
|
521
521
|
metadata: {}
|
522
|
-
post_install_message:
|
522
|
+
post_install_message:
|
523
523
|
rdoc_options: []
|
524
524
|
require_paths:
|
525
525
|
- lib
|
@@ -534,8 +534,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
534
534
|
- !ruby/object:Gem::Version
|
535
535
|
version: '0'
|
536
536
|
requirements: []
|
537
|
-
rubygems_version: 3.0.
|
538
|
-
signing_key:
|
537
|
+
rubygems_version: 3.0.6
|
538
|
+
signing_key:
|
539
539
|
specification_version: 4
|
540
540
|
summary: istox backend shared gem
|
541
541
|
test_files: []
|