anycable-core 1.3.1 → 1.4.0.pre.rc.1

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: 5eaf888f4c9312a81bbadf980e5279efa1a0403760569b0465a537e6bd2ed291
4
- data.tar.gz: 85206aa6fb8aac5faa0641c889deb9f4c61d40a27211feffb20ab23590313469
3
+ metadata.gz: 4ffabf719d153bb5390a13125389bf92b8d11a1b0a0f500774a95f50fd3cee14
4
+ data.tar.gz: 9db169beafb99939716eca55267c0b1df57fd1a91dd6f98edc156070b5809b6f
5
5
  SHA512:
6
- metadata.gz: 8eb1685bd731c6904126e0ea75a5f4489f268e97f080df60a6eec9ce3ae79cf7c3477ff5cf4add6541a7b09c21455c1d97ababcc1ad818f119e79ac6faf97e56
7
- data.tar.gz: 9d5c9882b1eb73901e253f64915c3647c38453357560d9ec836a29163aa3b6f24a10b485b1007751e3600f81a4e4a9cb8eb0a37204af35d87cc216934b7530c2
6
+ metadata.gz: bbfa0d23d3fcd4d395b66845169f286edf5c087303581c83f5163d647b8e5955fb3902139592e2ad15a469a00d619c99e70d3213195e1a52d08cb52c528a1520
7
+ data.tar.gz: dd417c36b177f39aa2c8ac0ce72d0f5fe56197dfa3432d8242f074733c3d6fe8fd4085334c39df14f5afb71937acab1e12d96b5dbf2105a45177698d795d0f4b
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 1.4.0-rc.1 (2023-06-01)
6
+
7
+ - Add `redisx` broadcast adapter. ([@palkan][])
8
+
9
+ A next-gen (Broker-compatible) broadcasting adapter using Redis Streams.
10
+
5
11
  ## 1.3.1 (2023-05-12)
6
12
 
7
13
  - Fix gRPC health check response for an empty service. ([@palkan][])
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "anycable/broadcast_adapters/redis"
4
+
5
+ module AnyCable
6
+ module BroadcastAdapters
7
+ # Next-gen Redis adapter for broadcasting over Redis streams.
8
+ #
9
+ # Unlike Redis adapter, RedisX adapter delivers each broadcast message only
10
+ # to a single WS server, which is responsible for re-broadcasting it within the cluster.
11
+ # It's required for the Broker (hot streams cache) support.
12
+ #
13
+ # Example:
14
+ #
15
+ # AnyCable.broadcast_adapter = :redisx
16
+ #
17
+ # It uses Redis configuration from global AnyCable config
18
+ # by default.
19
+ # NOTE: The `redis_channel` config param is used as a stream name.
20
+ #
21
+ # You can override these params:
22
+ #
23
+ # AnyCable.broadcast_adapter = :redisx, { url: "redis://my_redis", stream_name: "_any_cable_" }
24
+ class Redisx < Redis
25
+ def raw_broadcast(payload)
26
+ redis_conn.xadd(channel, {payload: payload})
27
+ end
28
+
29
+ def announce!
30
+ logger.info "Broadcasting Redis stream: #{channel}"
31
+ end
32
+ end
33
+ end
34
+ end
@@ -27,7 +27,7 @@ module AnyCable
27
27
  broadcast_adapter: :redis,
28
28
 
29
29
  ### Redis options
30
- redis_url: ENV.fetch("REDIS_URL", "redis://localhost:6379/5"),
30
+ redis_url: ENV.fetch("REDIS_URL", "redis://localhost:6379"),
31
31
  redis_sentinels: nil,
32
32
  redis_channel: "__anycable__",
33
33
  redis_tls_verify: false,
@@ -71,7 +71,7 @@ module AnyCable
71
71
  flag_options :debug, :nats_dont_randomize_servers
72
72
  ignore_options :nats_options
73
73
 
74
- def load(*)
74
+ def load(*_args)
75
75
  super.tap { load_presets }
76
76
  end
77
77
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AnyCable
4
- VERSION = "1.3.1"
4
+ VERSION = "1.4.0-rc.1"
5
5
  end
@@ -0,0 +1,6 @@
1
+ module AnyCable
2
+ module BroadcastAdapters
3
+ class Redisx < Redis
4
+ end
5
+ end
6
+ end
data/sig/manifest.yml ADDED
@@ -0,0 +1,6 @@
1
+ dependencies:
2
+ - name: logger
3
+ - name: openssl
4
+ - name: optparse
5
+ - name: json
6
+ - name: pathname
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.3.1
4
+ version: 1.4.0.pre.rc.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - palkan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-12 00:00:00.000000000 Z
11
+ date: 2023-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anyway_config
@@ -201,6 +201,7 @@ files:
201
201
  - lib/anycable/broadcast_adapters/http.rb
202
202
  - lib/anycable/broadcast_adapters/nats.rb
203
203
  - lib/anycable/broadcast_adapters/redis.rb
204
+ - lib/anycable/broadcast_adapters/redisx.rb
204
205
  - lib/anycable/cli.rb
205
206
  - lib/anycable/config.rb
206
207
  - lib/anycable/exceptions_handling.rb
@@ -236,6 +237,7 @@ files:
236
237
  - sig/anycable/broadcast_adapters/http.rbs
237
238
  - sig/anycable/broadcast_adapters/nats.rbs
238
239
  - sig/anycable/broadcast_adapters/redis.rbs
240
+ - sig/anycable/broadcast_adapters/redisx.rbs
239
241
  - sig/anycable/cli.rbs
240
242
  - sig/anycable/config.rbs
241
243
  - sig/anycable/exceptions_handling.rbs
@@ -256,6 +258,7 @@ files:
256
258
  - sig/anycable/rpc/handlers/disconnect.rbs
257
259
  - sig/anycable/socket.rbs
258
260
  - sig/anycable/version.rbs
261
+ - sig/manifest.yml
259
262
  homepage: http://github.com/anycable/anycable
260
263
  licenses:
261
264
  - MIT
@@ -277,9 +280,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
277
280
  version: 2.7.0
278
281
  required_rubygems_version: !ruby/object:Gem::Requirement
279
282
  requirements:
280
- - - ">="
283
+ - - ">"
281
284
  - !ruby/object:Gem::Version
282
- version: '0'
285
+ version: 1.3.1
283
286
  requirements: []
284
287
  rubygems_version: 3.4.8
285
288
  signing_key: