diff options
Diffstat (limited to 'actioncable/test/stubs/test_server.rb')
-rw-r--r-- | actioncable/test/stubs/test_server.rb | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/actioncable/test/stubs/test_server.rb b/actioncable/test/stubs/test_server.rb index b86f422a13..0bc4625e28 100644 --- a/actioncable/test/stubs/test_server.rb +++ b/actioncable/test/stubs/test_server.rb @@ -1,4 +1,6 @@ -require 'ostruct' +# frozen_string_literal: true + +require "ostruct" class TestServer include ActionCable::Server::Connections @@ -10,14 +12,8 @@ class TestServer @logger = ActiveSupport::TaggedLogging.new ActiveSupport::Logger.new(StringIO.new) @config = OpenStruct.new(log_tags: [], subscription_adapter: subscription_adapter) - @config.use_faye = ENV['FAYE'].present? - @config.client_socket_class = if @config.use_faye - ActionCable::Connection::FayeClientSocket - else - ActionCable::Connection::ClientSocket - end - - @mutex = Monitor.new + + @mutex = Monitor.new end def pubsub @@ -25,11 +21,9 @@ class TestServer end def event_loop - @event_loop ||= if @config.use_faye - ActionCable::Connection::FayeEventLoop.new - else - ActionCable::Connection::StreamEventLoop.new - end + @event_loop ||= ActionCable::Connection::StreamEventLoop.new.tap do |loop| + loop.instance_variable_set(:@executor, Concurrent.global_io_executor) + end end def worker_pool |