anyt 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/anyt/ext/minitest.rb +2 -2
- data/lib/anyt/rpc.rb +2 -3
- data/lib/anyt/tests/features/channel_state_test.rb +2 -2
- data/lib/anyt/tests/request/disconnection_test.rb +3 -3
- data/lib/anyt/tests/streams/broadcast_test.rb +1 -1
- data/lib/anyt/tests/streams/multiple_clients_test.rb +3 -3
- data/lib/anyt/tests/streams/multiple_test.rb +5 -5
- data/lib/anyt/tests/streams/single_test.rb +5 -5
- data/lib/anyt/tests/streams/stop_test.rb +4 -4
- data/lib/anyt/tests/subscriptions/perform_test.rb +1 -1
- data/lib/anyt/version.rb +1 -1
- metadata +18 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae6e9315f47d249825321f25325b732f6c772c038897e276be2808c67a6a825c
|
4
|
+
data.tar.gz: 0561047ee5e30ee0ad01dd39963d6b637c813fb2edc0a1661314b3079e5ce605
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ecf5301765607d5e4b724f77754bd37e0ec8e870a29e5e5e881db1bec7ec2ee14b7715512b5d84fee2e454035da2ae8c4661675d08d49107b7bf59f5b37bc95
|
7
|
+
data.tar.gz: 2a660e68240cf6a295873eb099b635d756482419703034074fcd00fe934a7cb8ca7e26b6d8e850c8eb95e0a1cefe2d8183bde53d4a97641d3b43a416f62bb3a5
|
data/lib/anyt/ext/minitest.rb
CHANGED
@@ -12,9 +12,9 @@ module Anyt
|
|
12
12
|
base.after { @clients&.each { |client| client.close(allow_messages: true) } }
|
13
13
|
end
|
14
14
|
|
15
|
-
def build_client(
|
15
|
+
def build_client(**args)
|
16
16
|
@clients ||= []
|
17
|
-
Anyt::Client.new(
|
17
|
+
Anyt::Client.new(**args).tap do |client|
|
18
18
|
@clients << client
|
19
19
|
end
|
20
20
|
end
|
data/lib/anyt/rpc.rb
CHANGED
@@ -19,10 +19,9 @@ module Anyt # :nodoc:
|
|
19
19
|
|
20
20
|
AnyCable.server_callbacks.each(&:call)
|
21
21
|
|
22
|
-
@server = AnyCable::Server.new(
|
22
|
+
@server = AnyCable::GRPC::Server.new(
|
23
23
|
host: AnyCable.config.rpc_host,
|
24
|
-
**AnyCable.config.to_grpc_params
|
25
|
-
interceptors: AnyCable.middleware.to_a
|
24
|
+
**AnyCable.config.to_grpc_params
|
26
25
|
)
|
27
26
|
|
28
27
|
AnyCable.middleware.freeze
|
@@ -13,13 +13,13 @@ feature "Channel state" do
|
|
13
13
|
|
14
14
|
def tick
|
15
15
|
self.count += 2
|
16
|
-
transmit(count: count, name: user[:name])
|
16
|
+
transmit({count: count, name: user[:name]})
|
17
17
|
end
|
18
18
|
|
19
19
|
def unsubscribed
|
20
20
|
return unless params["notify_disconnect"]
|
21
21
|
|
22
|
-
ActionCable.server.broadcast("state_counts", data: "user left: #{user[:name]}")
|
22
|
+
ActionCable.server.broadcast("state_counts", {data: "user left: #{user[:name]}"})
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -7,7 +7,7 @@ feature "Request" do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def unsubscribed
|
10
|
-
ActionCable.server.broadcast("request_a", data: "user left")
|
10
|
+
ActionCable.server.broadcast("request_a", {data: "user left"})
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
@@ -17,7 +17,7 @@ feature "Request" do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def unsubscribed
|
20
|
-
ActionCable.server.broadcast("request_b", data: "user left")
|
20
|
+
ActionCable.server.broadcast("request_b", {data: "user left"})
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -27,7 +27,7 @@ feature "Request" do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def unsubscribed
|
30
|
-
ActionCable.server.broadcast("request_c", data: "user left#{params[:id].presence}")
|
30
|
+
ActionCable.server.broadcast("request_c", {data: "user left#{params[:id].presence}"})
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -26,7 +26,7 @@ feature "Streams with many clients" do
|
|
26
26
|
scenario %(
|
27
27
|
Multiple clients receive messages from stream
|
28
28
|
) do
|
29
|
-
ActionCable.server.broadcast("a", data: "X")
|
29
|
+
ActionCable.server.broadcast("a", {data: "X"})
|
30
30
|
|
31
31
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
|
32
32
|
|
@@ -37,7 +37,7 @@ feature "Streams with many clients" do
|
|
37
37
|
scenario %(
|
38
38
|
Client receive messages when another client removes subscription
|
39
39
|
) do
|
40
|
-
ActionCable.server.broadcast("a", data: "X")
|
40
|
+
ActionCable.server.broadcast("a", {data: "X"})
|
41
41
|
|
42
42
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
|
43
43
|
|
@@ -51,7 +51,7 @@ feature "Streams with many clients" do
|
|
51
51
|
# ActionCable doesn't provide an unsubscription ack :(
|
52
52
|
sleep 1
|
53
53
|
|
54
|
-
ActionCable.server.broadcast("a", data: "Y")
|
54
|
+
ActionCable.server.broadcast("a", {data: "Y"})
|
55
55
|
|
56
56
|
msg2 = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "Y"}}
|
57
57
|
|
@@ -23,13 +23,13 @@ feature "Multiple streams" do
|
|
23
23
|
scenario %(
|
24
24
|
Client receives messages from both streams
|
25
25
|
) do
|
26
|
-
ActionCable.server.broadcast("a", data: "X")
|
26
|
+
ActionCable.server.broadcast("a", {data: "X"})
|
27
27
|
|
28
28
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
|
29
29
|
|
30
30
|
assert_equal msg, client.receive
|
31
31
|
|
32
|
-
ActionCable.server.broadcast("b", data: "Y")
|
32
|
+
ActionCable.server.broadcast("b", {data: "Y"})
|
33
33
|
|
34
34
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "Y"}}
|
35
35
|
|
@@ -39,7 +39,7 @@ feature "Multiple streams" do
|
|
39
39
|
scenario %(
|
40
40
|
Client does not receive messages from any stream after removing subscription
|
41
41
|
) do
|
42
|
-
ActionCable.server.broadcast("a", data: "X")
|
42
|
+
ActionCable.server.broadcast("a", {data: "X"})
|
43
43
|
|
44
44
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
|
45
45
|
|
@@ -52,8 +52,8 @@ feature "Multiple streams" do
|
|
52
52
|
# ActionCable doesn't provide an unsubscription ack :(
|
53
53
|
sleep 1
|
54
54
|
|
55
|
-
ActionCable.server.broadcast("a", data: "Y")
|
56
|
-
ActionCable.server.broadcast("b", data: "Z")
|
55
|
+
ActionCable.server.broadcast("a", {data: "Y"})
|
56
|
+
ActionCable.server.broadcast("b", {data: "Z"})
|
57
57
|
|
58
58
|
assert_raises(Anyt::Client::TimeoutError) { client.receive(timeout: 0.5) }
|
59
59
|
end
|
@@ -22,13 +22,13 @@ feature "Single stream" do
|
|
22
22
|
scenario %(
|
23
23
|
Client receives messages from the stream
|
24
24
|
) do
|
25
|
-
ActionCable.server.broadcast("a", data: "X")
|
25
|
+
ActionCable.server.broadcast("a", {data: "X"})
|
26
26
|
|
27
27
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
|
28
28
|
|
29
29
|
assert_equal msg, client.receive
|
30
30
|
|
31
|
-
ActionCable.server.broadcast("a", data: "Y")
|
31
|
+
ActionCable.server.broadcast("a", {data: "Y"})
|
32
32
|
|
33
33
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "Y"}}
|
34
34
|
|
@@ -38,7 +38,7 @@ feature "Single stream" do
|
|
38
38
|
scenario %(
|
39
39
|
Client does not receive messages from the stream after removing subscription
|
40
40
|
) do
|
41
|
-
ActionCable.server.broadcast("a", data: "X")
|
41
|
+
ActionCable.server.broadcast("a", {data: "X"})
|
42
42
|
|
43
43
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
|
44
44
|
|
@@ -51,7 +51,7 @@ feature "Single stream" do
|
|
51
51
|
# ActionCable doesn't provide an unsubscription ack :(
|
52
52
|
sleep 1
|
53
53
|
|
54
|
-
ActionCable.server.broadcast("a", data: "Y")
|
54
|
+
ActionCable.server.broadcast("a", {data: "Y"})
|
55
55
|
|
56
56
|
assert_raises(Anyt::Client::TimeoutError) { client.receive(timeout: 0.5) }
|
57
57
|
end
|
@@ -70,7 +70,7 @@ feature "Single stream" do
|
|
70
70
|
|
71
71
|
assert_equal ack, client.receive
|
72
72
|
|
73
|
-
ActionCable.server.broadcast("a", data: "XX")
|
73
|
+
ActionCable.server.broadcast("a", {data: "XX"})
|
74
74
|
|
75
75
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "XX"}}
|
76
76
|
msg2 = {"identifier" => {channel: channel, some_param: "test"}.to_json, "message" => {"data" => "XX"}}
|
@@ -8,7 +8,7 @@ feature "Stop streams" do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def ping(data)
|
11
|
-
ActionCable.server.broadcast data["name"], reply: "pong"
|
11
|
+
ActionCable.server.broadcast data["name"], {reply: "pong"}
|
12
12
|
end
|
13
13
|
|
14
14
|
def unfollow(data)
|
@@ -33,7 +33,7 @@ feature "Stop streams" do
|
|
33
33
|
) do
|
34
34
|
skip if Anyt.config.use_action_cable && (::ActionCable::VERSION::MAJOR < 6 || ::ActionCable::VERSION::MINOR < 1)
|
35
35
|
|
36
|
-
ActionCable.server.broadcast("a", data: "X")
|
36
|
+
ActionCable.server.broadcast("a", {data: "X"})
|
37
37
|
|
38
38
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
|
39
39
|
|
@@ -47,9 +47,9 @@ feature "Stop streams" do
|
|
47
47
|
client.send(perform_request)
|
48
48
|
sleep 0.2 # give some time to commit unsubscribe
|
49
49
|
|
50
|
-
ActionCable.server.broadcast("a", data: "Y")
|
50
|
+
ActionCable.server.broadcast("a", {data: "Y"})
|
51
51
|
sleep 0.2 # "a" should be broadcasted first
|
52
|
-
ActionCable.server.broadcast("b", data: "Z")
|
52
|
+
ActionCable.server.broadcast("b", {data: "Z"})
|
53
53
|
|
54
54
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "Z"}}
|
55
55
|
assert_equal msg, client.receive
|
data/lib/anyt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anyt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- palkan
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -58,28 +58,34 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '6.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '6.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: anycable-rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.0.
|
75
|
+
version: 1.0.99
|
76
|
+
- - "<"
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '2.0'
|
76
79
|
type: :runtime
|
77
80
|
prerelease: false
|
78
81
|
version_requirements: !ruby/object:Gem::Requirement
|
79
82
|
requirements:
|
80
|
-
- - "
|
83
|
+
- - ">"
|
81
84
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.0.
|
85
|
+
version: 1.0.99
|
86
|
+
- - "<"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '2.0'
|
83
89
|
- !ruby/object:Gem::Dependency
|
84
90
|
name: redis
|
85
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -243,7 +249,7 @@ homepage: http://github.com/anycable/anyt
|
|
243
249
|
licenses:
|
244
250
|
- MIT
|
245
251
|
metadata: {}
|
246
|
-
post_install_message:
|
252
|
+
post_install_message:
|
247
253
|
rdoc_options: []
|
248
254
|
require_paths:
|
249
255
|
- lib
|
@@ -258,8 +264,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
258
264
|
- !ruby/object:Gem::Version
|
259
265
|
version: '0'
|
260
266
|
requirements: []
|
261
|
-
rubygems_version: 3.
|
262
|
-
signing_key:
|
267
|
+
rubygems_version: 3.2.15
|
268
|
+
signing_key:
|
263
269
|
specification_version: 4
|
264
270
|
summary: Anycable conformance testing tool
|
265
271
|
test_files: []
|