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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40134b310d42956b75cf92aa03fe2a8c48597f1642b086b12303dacced180cdd
4
- data.tar.gz: 394b3e1520a0cecee8772d21cecd77a060bcb911d439824fbb0bf687b0f53c84
3
+ metadata.gz: f03694df6d633293eb1be3232fe214f6a63a319fa0eb912620ab15dfdf9a0055
4
+ data.tar.gz: 520eaf6748691388d33506fa84a6f8eb54c98e01530ecfb3b83857979c3e0e12
5
5
  SHA512:
6
- metadata.gz: 3f53c5b806abb449c7a4ef5c084a23294af5496eaf868631dbbfce9f6c6ab1a8c701a86fa78c78e4cd464a0ecb722a1982c3d2eb83c7ee01e964fc889b205a10
7
- data.tar.gz: 4d7ad5f4ac53858d923fbde8f2ef8ee8cca026198f9eaf49661480f2e593a4ae70fbb3b7c18b7940c5a2cd0995b14574d32eb79bc377d75001c9fbf4dcb96774
6
+ metadata.gz: cc49c818b215646b1694d099f1f5385ffbccc1d71fa20c54674580b2ab92ca551265209607c72f6373940e2c11717faa339c39b35f7ff6ba669770757ab30217
7
+ data.tar.gz: fbb78baf478be1041b108c1d42d14c90bb956141132db30172d76d2660bce45c450cfef93dfd418d589309ed8926a64856606ee8f258567d1d16b406b814448d
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2016-2020 palkan
1
+ Copyright 2016-2026 palkan
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
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
@@ -5,6 +5,10 @@ feature "Single stream" do
5
5
  def subscribed
6
6
  stream_from "a"
7
7
  end
8
+
9
+ def follow(data)
10
+ stream_from data["name"]
11
+ end
8
12
  end
9
13
 
10
14
  before do
data/lib/anyt/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Anyt
4
- VERSION = "1.4.2"
4
+ VERSION = "1.5.0"
5
5
  end
data/lib/anyt.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "logger"
3
4
  require "anyt/version"
4
5
  require "anyt/config"
5
6
  require "anyt/utils"
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.2
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: 2025-01-02 00:00:00.000000000 Z
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: []