anycable-core 1.1.1 → 1.2.0

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: d11579bf58a9da203b2da00e291908a62fbecab16fd4d7f00edddb25ab9bf5e2
4
- data.tar.gz: 7a5c5f9a04d98d6429b45c27e3fd11482e961712134869a95223ef25d21fa483
3
+ metadata.gz: b4c85f8eab809e414507ed9e35da7381b9ca2626ad4c9e2e4f84a5ee8dda2d09
4
+ data.tar.gz: 37edd04f4c524384c989a774f94e7a8ede624f7fe95e3a6f1a864f2c11f03b4e
5
5
  SHA512:
6
- metadata.gz: 77a5854249cf452531bbc9b51c0b2e9fb8c53358f0debfe5e78bb223f033170ed951030d0449b17d63c70d8e30375da3c761b9256b74f4f4365edcf3ea61a003
7
- data.tar.gz: 6451a760177621c53d0e78cb623c014d9e63cd643fae4d988f8ba4cd53db6b9eae6b63cc274892aaf85e419f35a8db375af5591902dbb96fd7219a0db910914f
6
+ metadata.gz: 15602cd4712a4a451e41c03035b176d0fc276593852ab93f386e588d297f7a3e7be8284e8feb952fb19b8a0918973edb48c6a9ce2bd0fb8a63a0ceb068c12730
7
+ data.tar.gz: a8453ffddde915bd88e2c5fd8cad6178194c8ca7ad3193f617157c6a92b5504022d4a11572e7bb61cc9157897857ab00b7dbab609961ee9ad7d9b55321f66ea9
data/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 1.2.0 (2021-12-21) 🎄
6
+
7
+ - Drop Ruby 2.6 support.
8
+
9
+ ## 1.1.4 (2021-11-11)
10
+
11
+ - Do not swallow `grpc` missing .so exceptions. ([@palkan][])
12
+
13
+ ## 1.1.3 (2021-09-29)
14
+
15
+ - Added support for type coercion from Anyway Config 2.2. ([@palkan][])
16
+
17
+ ## 1.1.2 (2021-09-10) 🤵👰
18
+
19
+ - Improved gRPC server args support. ([@palkan][])
20
+
21
+ Add ability to declare gRPC server args without namespacing (i.e., `"max_connection_age_ms"` instead of `"grpc.max_connection_age_ms"`). That makes it possible to use ENV vars to provide the gRPC configuration.
22
+
5
23
  ## 1.1.1 (2021-06-05)
6
24
 
7
25
  - Fixed error message when RPC implementation is missing. ([@palkan][])
data/README.md CHANGED
@@ -12,6 +12,8 @@ AnyCable allows you to use any WebSocket server (written in any language) as a r
12
12
 
13
13
  AnyCable uses the same protocol as ActionCable, so you can use its [JavaScript client](https://www.npmjs.com/package/actioncable) without any monkey-patching.
14
14
 
15
+ > [AnyCable Pro](https://docs.anycable.io/pro) has been launched 🚀
16
+
15
17
  <a href="https://evilmartians.com/">
16
18
  <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Sponsored by Evil Martians" width="236" height="54"></a>
17
19
 
@@ -46,7 +46,9 @@ module AnyCable
46
46
  version_check_enabled: true
47
47
  )
48
48
 
49
- alias_method :version_check_enabled?, :version_check_enabled
49
+ if respond_to?(:coerce_types)
50
+ coerce_types redis_sentinels: {type: nil, array: true}, debug: :boolean, version_check_enabled: :boolean
51
+ end
50
52
 
51
53
  flag_options :debug
52
54
 
@@ -8,7 +8,7 @@ AnyCable::Config.attr_config(
8
8
  rpc_max_waiting_requests: ::GRPC::RpcServer::DEFAULT_MAX_WAITING_REQUESTS,
9
9
  rpc_poll_period: ::GRPC::RpcServer::DEFAULT_POLL_PERIOD,
10
10
  rpc_pool_keep_alive: ::GRPC::Pool::DEFAULT_KEEP_ALIVE,
11
- # See https://github.com/grpc/grpc/blob/f526602bff029b8db50a8d57134d72da33d8a752/include/grpc/impl/codegen/grpc_types.h#L292-L315
11
+ # https://github.com/grpc/grpc/blob/f526602bff029b8db50a8d57134d72da33d8a752/include/grpc/impl/codegen/grpc_types.h#L141-L351
12
12
  rpc_server_args: {},
13
13
  log_grpc: false
14
14
  )
@@ -33,9 +33,19 @@ module AnyCable
33
33
  max_waiting_requests: rpc_max_waiting_requests,
34
34
  poll_period: rpc_poll_period,
35
35
  pool_keep_alive: rpc_pool_keep_alive,
36
- server_args: rpc_server_args
36
+ server_args: normalized_grpc_server_args
37
37
  }
38
38
  end
39
+
40
+ def normalized_grpc_server_args
41
+ val = rpc_server_args
42
+ return {} unless val.is_a?(Hash)
43
+
44
+ val.transform_keys do |key|
45
+ skey = key.to_s
46
+ skey.start_with?("grpc.") ? skey : "grpc.#{skey}"
47
+ end
48
+ end
39
49
  end
40
50
  end
41
51
  end
data/lib/anycable/grpc.rb CHANGED
@@ -16,7 +16,6 @@ AnyCable.server_builder = ->(config) {
16
16
  ::GRPC.define_singleton_method(:logger) { AnyCable.logger } if config.log_grpc?
17
17
 
18
18
  params = config.to_grpc_params
19
- params[:host] = config.rpc_host
20
19
 
21
- AnyCable::GRPC::Server.new(**params)
20
+ AnyCable::GRPC::Server.new(**params, host: config.rpc_host)
22
21
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AnyCable
4
- VERSION = "1.1.1"
4
+ VERSION = "1.2.0"
5
5
  end
data/lib/anycable.rb CHANGED
@@ -111,5 +111,8 @@ end
111
111
  # gRPC is the default for now, so, let's try to load it.
112
112
  begin
113
113
  require "anycable/grpc"
114
- rescue LoadError
114
+ rescue LoadError => e
115
+ # Re-raise an exception if we failed to load grpc .so files
116
+ # (e.g., on Alpine Linux)
117
+ raise if /Error loading shared library/.match?(e.message)
115
118
  end
data/sig/anycable/rpc.rbs CHANGED
@@ -19,13 +19,13 @@ module AnyCable
19
19
  attr_accessor url: String
20
20
  attr_accessor headers: protoMap
21
21
 
22
- def initialize: (?url: String, ?headers: protoMap, ?cstate: protoMap, ?istate: protoMap) -> void
22
+ def initialize: (?url: String, ?headers: protoMap, ?cstate: protoMap?, ?istate: protoMap?) -> void
23
23
  end
24
24
 
25
25
  class EnvResponse
26
26
  include _WithEnvState
27
27
 
28
- def initialize: (?cstate: protoMap, ?istate: protoMap) -> void
28
+ def initialize: (?cstate: protoMap?, ?istate: protoMap?) -> void
29
29
  end
30
30
 
31
31
  interface _ProtoMessage
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anycable-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - palkan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-05 00:00:00.000000000 Z
11
+ date: 2021-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anyway_config
@@ -224,14 +224,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
224
224
  requirements:
225
225
  - - ">="
226
226
  - !ruby/object:Gem::Version
227
- version: 2.6.0
227
+ version: 2.7.0
228
228
  required_rubygems_version: !ruby/object:Gem::Requirement
229
229
  requirements:
230
230
  - - ">="
231
231
  - !ruby/object:Gem::Version
232
232
  version: '0'
233
233
  requirements: []
234
- rubygems_version: 3.2.15
234
+ rubygems_version: 3.2.22
235
235
  signing_key:
236
236
  specification_version: 4
237
237
  summary: AnyCable core RPC implementation