Skip to content

Commit 93b2a2c

Browse files
authored
Merge pull request rails#46106 from MSP-Greg/00-puma-6
Updates for Puma 6
2 parents 6c70d02 + 6c674e4 commit 93b2a2c

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ end
7979

8080
# Action Cable
8181
group :cable do
82-
gem "puma", require: false
82+
gem "puma", ">= 5.0.3", require: false
8383

8484
gem "redis", ">= 4.0.1", require: false
8585

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ GEM
372372
rack
373373
railties (>= 7.0.0.alpha2)
374374
public_suffix (4.0.6)
375-
puma (5.5.2)
375+
puma (5.6.5)
376376
nio4r (~> 2.0)
377377
queue_classic (4.0.0)
378378
pg (>= 1.1, < 2.0)
@@ -587,7 +587,7 @@ DEPENDENCIES
587587
nokogiri (>= 1.8.1, != 1.11.0)
588588
pg (~> 1.3)
589589
propshaft (>= 0.1.7)
590-
puma
590+
puma (>= 5.0.3)
591591
queue_classic (>= 4.0.0)
592592
racc (>= 1.4.6)
593593
rack-cache (~> 1.2)

actioncable/test/client_test.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,15 @@ def setup
7474
end
7575

7676
def with_puma_server(rack_app = ActionCable.server, port = 3099)
77-
server = ::Puma::Server.new(rack_app, ::Puma::Events.strings)
77+
opts = { min_threads: 1, max_threads: 4 }
78+
server = if Puma::Const::PUMA_VERSION >= "6"
79+
opts[:log_writer] = ::Puma::LogWriter.strings
80+
::Puma::Server.new(rack_app, nil, opts)
81+
else
82+
# Puma >= 5.0.3
83+
::Puma::Server.new(rack_app, ::Puma::Events.strings, opts)
84+
end
7885
server.add_tcp_listener "127.0.0.1", port
79-
server.min_threads = 1
80-
server.max_threads = 4
8186

8287
thread = server.run
8388

0 commit comments

Comments
 (0)