anycable-core 1.5.0.rc.1 → 1.5.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: b3469966952c29b422b3177acbb3402fc9bf500786d55774f9b3311b904548bb
4
- data.tar.gz: 7e5a7302b61c07af90f61b11878212a464ba1eac0f7d6b664f91b8dcbd3fe9e6
3
+ metadata.gz: 51822ff8e8b07d8967dfaeed99b65c45e7cf8a2d3868f94f09dd81a26d934bd8
4
+ data.tar.gz: d782bdda587a181716bd0d6dc0aa19d0a6c24b0236b0cb3aa3354100364839a8
5
5
  SHA512:
6
- metadata.gz: 57e7aafe42eeddf359db963a688cf89acf9b109935f4561ba2eb4cb9c994e3a47d44b721b24f717be41630d4b8234d5f77a12d91246b0033e2385772287c43af
7
- data.tar.gz: 53785ae7eaf8c86d1f164a89dbfeaee2063be1c4180f2a263cb2f47ca3ca41bc528f545ba65c1232c691fa6515bd4be39e9f6200b903b9b2bb8af02f09f37ccc
6
+ metadata.gz: f2f48cae19656f6b3360f8173a76d91ec2e6bf87434c7b8ccc00e3fae5dd3f89542f8d545348944b2eee90068833cc74fbf33be929885eb0427c019f9a0c9ba1
7
+ data.tar.gz: 00a17dedd9dd6f572aca18fe08f77d5d234c5b5636497f2b925b5dafbb230c4b918d4a4fa5a020d1adb612d9c11528554579e9ec81589b336081792249029a3d
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 1.5.0 (2024-04-01)
6
+
7
+ - Fixed gRPC keepalive settings to align with the Go server client. ([@palkan][])
8
+
5
9
  - Added JWT utils. ([@palkan][])
6
10
 
7
11
  You can now generate and verify AnyCable JWT tokens without using additional dependencies:
@@ -35,7 +35,15 @@ module AnyCable
35
35
  poll_period: rpc_poll_period,
36
36
  pool_keep_alive: rpc_pool_keep_alive,
37
37
  tls_credentials: tls_credentials,
38
- server_args: enhance_grpc_server_args(normalized_grpc_server_args)
38
+ server_args: enhance_grpc_server_args(normalized_grpc_server_args).tap do |sargs|
39
+ # Provide keepalive defaults unless explicitly set.
40
+ # They must MATCH the corresponding Go client defaults:
41
+ # https://github.com/anycable/anycable-go/blob/62e77e7f759aa9253c2bd23812dd59ec8471db86/rpc/rpc.go#L512-L515
42
+ #
43
+ # See also https://github.com/grpc/grpc/blob/master/doc/keepalive.md and https://grpc.github.io/grpc/core/group__grpc__arg__keys.html
44
+ sargs["grpc.keepalive_permit_without_calls"] ||= 1
45
+ sargs["grpc.http2.min_recv_ping_interval_without_data_ms"] ||= 10_000
46
+ end
39
47
  }
40
48
  end
41
49
 
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AnyCable
4
+ WHISPER_KEY = "$w"
5
+
4
6
  # Socket mock to be used with application connection
5
7
  class Socket
6
8
  # Represents the per-connection store
@@ -59,10 +61,21 @@ module AnyCable
59
61
 
60
62
  def unsubscribe(_channel, broadcasting)
61
63
  streams[:stop] << broadcasting
64
+
65
+ if istate.read(WHISPER_KEY) == broadcasting
66
+ istate.write(WHISPER_KEY, "")
67
+ end
68
+ end
69
+
70
+ def whisper(_channel, broadcasting)
71
+ istate.write(WHISPER_KEY, broadcasting)
62
72
  end
63
73
 
64
74
  def unsubscribe_from_all(_channel)
65
75
  @stop_all_streams = true
76
+ if istate.read(WHISPER_KEY)
77
+ istate.write(WHISPER_KEY, "")
78
+ end
66
79
  end
67
80
 
68
81
  def streams
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AnyCable
4
- VERSION = "1.5.0.rc.1"
4
+ VERSION = "1.5.0"
5
5
  end
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.5.0.rc.1
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - palkan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-13 00:00:00.000000000 Z
11
+ date: 2024-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anyway_config
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: google-protobuf
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.13'
33
+ version: '3.25'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '3.13'
40
+ version: '3.25'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: redis
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -288,9 +288,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
288
288
  version: 2.7.0
289
289
  required_rubygems_version: !ruby/object:Gem::Requirement
290
290
  requirements:
291
- - - ">"
291
+ - - ">="
292
292
  - !ruby/object:Gem::Version
293
- version: 1.3.1
293
+ version: '0'
294
294
  requirements: []
295
295
  rubygems_version: 3.4.20
296
296
  signing_key: