anycable-rack-server 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24f1c49735812dcb78210baee266c923cf30b406f80490dd196e462cb3b05fb4
4
- data.tar.gz: 90816821cd539d770f2e30d72ee6fcc2d5b3a090b8326c2c92b89279719f75f7
3
+ metadata.gz: 0515017e6e7f746e09105d2feb3fdbbcad873c406ad0e4c3d11ae109eb952b26
4
+ data.tar.gz: fda34861fae7508fc64a1321d2346bd1ed47f5cce1d71044b4ef3b2d2d36e06b
5
5
  SHA512:
6
- metadata.gz: 7c3b837b537ae8bd2cc36686ee5c439f7251490df1e948849da3acdbd40bccbf0d5be69b4bb40e2ac0882889b89b5a79844963c3537f3b5c0d069e7d4c422128
7
- data.tar.gz: dfa7ac9e609e63e36d7a7331b6c75848499fa9a94d3fec6ad251c22e5ac4e0250622d6ce212dcaf50b1aeddd9dfa9258ef438b6ad74d6bd983d92d47e5829c09
6
+ metadata.gz: 8e82a0ddf031e13515d9d8df0a645f8aea5ab1c59241ffd3b9202906cca1c6c4b05393a2e51685e28da1e27a702d41f26a14fdb8d32bcf5ec42e9773b404348d
7
+ data.tar.gz: 1e0d334e324695a6b583be61da56bc28a40dd030aef7f8c35941085c0dea7cbb963fdd2da115adafac6d2459b3dc4951909c417433371577343d28c609928fb5
data/README.md CHANGED
@@ -74,7 +74,7 @@ config.any_cable_rack.rpc_port = 50051
74
74
 
75
75
  ## Broadcast adapters
76
76
 
77
- AnyCable Rack supports Redis (default) and HTTP broadcast adapters (see [the documentation](https://docs.anycable.io/v1/#/ruby/broadcast_adapters)).
77
+ AnyCable Rack supports Redis (default) and HTTP broadcast adapters (see [the documentation](https://docs.anycable.io/#/ruby/broadcast_adapters)).
78
78
 
79
79
  Broadcast adapter is inherited from AnyCable configuration (so, you don't need to configure it twice).
80
80
 
@@ -88,7 +88,8 @@ module AnyCable
88
88
  subscriptions: @_subscriptions.to_a,
89
89
  headers: headers,
90
90
  url: request.url,
91
- state: @_cstate
91
+ state: @_cstate,
92
+ channels_state: @_istate
92
93
  )
93
94
  end
94
95
 
@@ -42,20 +42,28 @@ module AnyCable
42
42
  end
43
43
  end
44
44
 
45
- def disconnect(identifiers:, subscriptions:, headers:, url:, state: nil)
45
+ def disconnect(identifiers:, subscriptions:, headers:, url:, state: nil, channels_state: nil)
46
46
  request = DisconnectRequest.new(
47
47
  identifiers: identifiers,
48
48
  subscriptions: subscriptions,
49
49
  env: Env.new(
50
50
  headers: headers,
51
51
  url: url,
52
- cstate: state
52
+ cstate: state,
53
+ istate: encode_istate(channels_state)
53
54
  )
54
55
  )
55
56
  pool.with do |stub|
56
57
  stub.disconnect(request, metadata)
57
58
  end
58
59
  end
60
+
61
+ private
62
+
63
+ # We need a string -> string Hash here
64
+ def encode_istate(state)
65
+ state.transform_values(&:to_json)
66
+ end
59
67
  end
60
68
  end
61
69
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module AnyCable
4
4
  module Rack
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anycable-rack-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yulia Oletskaya
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-06-30 00:00:00.000000000 Z
12
+ date: 2020-09-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: anyway_config