bmx-event_hook_client_server 1.0.9 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8aa2f598f1b92f1fa117ad7b60a8f2d8016ab311487ae067993ec8c10146e20f
4
- data.tar.gz: c2e270174199a50c05de0a411ab0d10521e532b5959c371d3f2690ccb747814f
3
+ metadata.gz: ba348e5adb1774b6668ff5e42a1610ca6e07a92e0f5713c22e07c315d815b695
4
+ data.tar.gz: bd3cd31a6bc0cf124fc65871a0088bbd30829f1df6e908179730073989dbf3d1
5
5
  SHA512:
6
- metadata.gz: 90f3c4abe395e650496dac57283e521809c9193de560c78bdf676440e4a55625ce207a88e813a589412834bd304620d13484bd7ad8d527f328ee0065a05cc5fb
7
- data.tar.gz: 9940ecc67d5430876675479e876efa2b6a5848be0b896a02be1f022342b155cc310ee1420072da235b4df916fc75ca0256b130dba1b366eb3dc87e07ae30a8f0
6
+ metadata.gz: 353aca747e8d7fd5747fc1964b684ab34737b45617255034dcc2f5de3d185fd0953162183f486dacc6965df22fec1c52aa144a0dfe0bb050b9145f428a6d5751
7
+ data.tar.gz: 4f20cdb0e00b3c09e426d36958b9669ec1cd8acb00f182b30cd10378b85aa97294bb280b4b0ae2558aef5c8248ffd256e9a026ae632ac17b3462ab66ace003f4
@@ -16,13 +16,21 @@ using EventHookClientServer::Refinements::Protobuf::HashableStructValues
16
16
 
17
17
  module EventHookClientServer
18
18
  class Client < EventHookClientServer::V1::Services::EventHook::Stub
19
+ # Configuration options can be found @
20
+ # https://github.com/grpc/grpc/issues/19734
19
21
  DEFAULT_CONFIG = {
20
22
  host: '0.0.0.0:3000',
21
23
  channel_mode: :this_channel_is_insecure,
22
- timeout: 6, # in seconds (negative number means disabled)
24
+ timeout: 300,
23
25
  channel_args: {
24
- 'grpc.min_reconnect_backoff_ms': 1_000,
25
- 'grpc.max_reconnect_backoff_ms': 5_000
26
+ 'grpc.min_reconnect_backoff_ms': 300,
27
+ 'grpc.max_reconnect_backoff_ms': 5 * 1000,
28
+ 'grpc.max_message_length': -1,
29
+ 'grpc.max_send_message_length': -1,
30
+ 'grpc.max_metadata_size': 10 * 1024 * 1024,
31
+ 'grpc.keepalive_time_ms': 100 * 1000,
32
+ 'grpc.keepalive_timeout_ms': 300 * 1000,
33
+ 'grpc.keepalive_permit_without_calls': 1
26
34
  }
27
35
  }.freeze
28
36
  private_constant :DEFAULT_CONFIG
@@ -4,6 +4,25 @@ require 'event_hook_client_server/protobuf/event_hook_client_server/v1/services/
4
4
 
5
5
  module EventHookClientServer
6
6
  class Server < EventHookClientServer::V1::Services::EventHook::Service
7
+ # Configuration options can be found @
8
+ # https://github.com/grpc/grpc/issues/19734
9
+ DEFAULT_CONFIG = {
10
+ host: '0.0.0.0:3000',
11
+ channel_mode: :this_channel_is_insecure,
12
+ timeout: 300,
13
+ channel_args: {
14
+ 'grpc.min_reconnect_backoff_ms': 300,
15
+ 'grpc.max_reconnect_backoff_ms': 5 * 1000,
16
+ 'grpc.max_message_length': -1,
17
+ 'grpc.max_send_message_length': -1,
18
+ 'grpc.max_metadata_size': 10 * 1024 * 1024,
19
+ 'grpc.keepalive_time_ms': 100 * 1000,
20
+ 'grpc.keepalive_timeout_ms': 300 * 1000,
21
+ 'grpc.keepalive_permit_without_calls': 1
22
+ }
23
+ }.freeze
24
+ private_constant :DEFAULT_CONFIG
25
+
7
26
  def self.generic_rpc(name, options = {})
8
27
  [
9
28
  [:create_],
@@ -29,7 +48,11 @@ module EventHookClientServer
29
48
  end
30
49
  end
31
50
 
32
- attr_accessor :logger
51
+ def self.default_config
52
+ @default_config ||= DEFAULT_CONFIG.dup
53
+ end
54
+
55
+ attr_writer :logger
33
56
  attr_accessor :handler
34
57
 
35
58
  def initialize(*args, logger: nil)
@@ -37,10 +60,11 @@ module EventHookClientServer
37
60
  super(*args)
38
61
  end
39
62
 
40
- def start!(binding_address: '0.0.0.0:3000', logger: nil)
63
+ def start!(binding_address: '0.0.0.0:3000', logger: nil, config: nil)
41
64
  self.logger = logger unless logger.nil?
42
65
 
43
- self.server = ::GRPC::RpcServer.new
66
+ config = self.class.default_config.merge(config || {})
67
+ self.server = ::GRPC::RpcServer.new(config)
44
68
  server.add_http2_port(binding_address, :this_port_is_insecure)
45
69
 
46
70
  self.logger
@@ -52,6 +76,7 @@ module EventHookClientServer
52
76
 
53
77
  def stop!
54
78
  return unless server
79
+
55
80
  server.stop
56
81
  end
57
82
 
@@ -3,6 +3,6 @@
3
3
  module EventHookClientServer
4
4
  MAJOR = 1
5
5
  MINOR = 0
6
- PATCH = 9
6
+ PATCH = 10
7
7
  VERSION = [MAJOR, MINOR, PATCH].join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bmx-event_hook_client_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stanko K.R.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-08 00:00:00.000000000 Z
11
+ date: 2019-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct