anyt-core 1.4.2 → 1.5.0
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 +4 -4
- data/MIT-LICENSE +1 -1
- data/lib/anyt/cli.rb +1 -1
- data/lib/anyt/dummy/application.rb +4 -0
- data/lib/anyt/tests/features/remote_disconnect_test.rb +39 -0
- data/lib/anyt/tests/streams/single_test.rb +4 -0
- data/lib/anyt/version.rb +1 -1
- data/lib/anyt.rb +1 -0
- metadata +33 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f03694df6d633293eb1be3232fe214f6a63a319fa0eb912620ab15dfdf9a0055
|
|
4
|
+
data.tar.gz: 520eaf6748691388d33506fa84a6f8eb54c98e01530ecfb3b83857979c3e0e12
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cc49c818b215646b1694d099f1f5385ffbccc1d71fa20c54674580b2ab92ca551265209607c72f6373940e2c11717faa339c39b35f7ff6ba669770757ab30217
|
|
7
|
+
data.tar.gz: fbb78baf478be1041b108c1d42d14c90bb956141132db30172d76d2660bce45c450cfef93dfd418d589309ed8926a64856606ee8f258567d1d16b406b814448d
|
data/MIT-LICENSE
CHANGED
data/lib/anyt/cli.rb
CHANGED
|
@@ -18,7 +18,7 @@ module Anyt
|
|
|
18
18
|
::File.join(::File.dirname(__FILE__), "dummy")
|
|
19
19
|
)
|
|
20
20
|
|
|
21
|
-
RAILS_COMMAND = "bundle exec puma #{DUMMY_ROOT} -t #{ENV.fetch("RAILS_MAX_THREADS", 5)}"
|
|
21
|
+
RAILS_COMMAND = "bundle exec puma #{DUMMY_ROOT} -t #{ENV.fetch("RAILS_MAX_THREADS", 5)} -p #{ENV.fetch("PUMA_PORT", 9292)}"
|
|
22
22
|
|
|
23
23
|
class << self
|
|
24
24
|
# CLI entrypoint
|
|
@@ -23,6 +23,10 @@ DISCONNECT_DELAY = ENV["ANYCABLE_DISCONNECT_DELAY"].to_f
|
|
|
23
23
|
|
|
24
24
|
module ApplicationCable
|
|
25
25
|
class Connection < ActionCable::Connection::Base
|
|
26
|
+
if respond_to?(:allow_public_streams?)
|
|
27
|
+
def allow_public_streams? = true
|
|
28
|
+
end
|
|
29
|
+
|
|
26
30
|
delegate :params, to: :request
|
|
27
31
|
|
|
28
32
|
identified_by :uid
|
|
@@ -32,4 +32,43 @@ feature "Remote disconnect" do
|
|
|
32
32
|
client.wait_for_close
|
|
33
33
|
assert client.closed?
|
|
34
34
|
end
|
|
35
|
+
|
|
36
|
+
scenario %(
|
|
37
|
+
Close all connections with the same id
|
|
38
|
+
) do
|
|
39
|
+
client = build_client(qs: "test=uid&uid=27", ignore: %w[ping])
|
|
40
|
+
assert_message({"type" => "welcome"}, client.receive)
|
|
41
|
+
|
|
42
|
+
client2 = build_client(qs: "test=uid&uid=27", ignore: %w[ping])
|
|
43
|
+
assert_message({"type" => "welcome"}, client2.receive)
|
|
44
|
+
|
|
45
|
+
other_client = build_client(qs: "test=uid&uid=28", ignore: %w[ping])
|
|
46
|
+
assert_message({"type" => "welcome"}, other_client.receive)
|
|
47
|
+
|
|
48
|
+
# Prevent race conditions when we send disconnect before internal channel subscription has been made
|
|
49
|
+
# (only for Action Cable)
|
|
50
|
+
sleep 1
|
|
51
|
+
ActionCable.server.remote_connections.where(uid: "27").disconnect
|
|
52
|
+
|
|
53
|
+
[client, client2].each do |c|
|
|
54
|
+
# Waiting for https://github.com/rails/rails/pull/39544
|
|
55
|
+
unless Anyt.config.use_action_cable
|
|
56
|
+
assert_message(
|
|
57
|
+
{
|
|
58
|
+
"type" => "disconnect",
|
|
59
|
+
"reconnect" => true,
|
|
60
|
+
"reason" => "remote"
|
|
61
|
+
},
|
|
62
|
+
c.receive
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
c.wait_for_close
|
|
67
|
+
assert c.closed?
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Connection with a different id must stay open
|
|
71
|
+
assert_raises(Anyt::Client::TimeoutError) { other_client.receive(timeout: 0.5) }
|
|
72
|
+
refute other_client.closed?
|
|
73
|
+
end
|
|
35
74
|
end
|
data/lib/anyt/version.rb
CHANGED
data/lib/anyt.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: anyt-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.5.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: 2026-11-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rack
|
|
@@ -94,6 +94,34 @@ dependencies:
|
|
|
94
94
|
- - "~>"
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: '1.0'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: drb
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - ">="
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '0'
|
|
104
|
+
type: :runtime
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - ">="
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '0'
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: mutex_m
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - ">="
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: '0'
|
|
118
|
+
type: :runtime
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - ">="
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: '0'
|
|
97
125
|
description: Action Cable / AnyCable conformance testing tool
|
|
98
126
|
email:
|
|
99
127
|
- dementiev.vm@gmail.com
|
|
@@ -143,7 +171,7 @@ homepage: http://github.com/anycable/anyt
|
|
|
143
171
|
licenses:
|
|
144
172
|
- MIT
|
|
145
173
|
metadata: {}
|
|
146
|
-
post_install_message:
|
|
174
|
+
post_install_message:
|
|
147
175
|
rdoc_options: []
|
|
148
176
|
require_paths:
|
|
149
177
|
- lib
|
|
@@ -159,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
159
187
|
version: '0'
|
|
160
188
|
requirements: []
|
|
161
189
|
rubygems_version: 3.4.19
|
|
162
|
-
signing_key:
|
|
190
|
+
signing_key:
|
|
163
191
|
specification_version: 4
|
|
164
192
|
summary: Action Cable / AnyCable conformance testing tool
|
|
165
193
|
test_files: []
|