lib/pakyow/realtime/server.rb in pakyow-realtime-1.0.1 vs lib/pakyow/realtime/server.rb in pakyow-realtime-1.0.2

- old
+ new

@@ -1,10 +1,10 @@ # frozen_string_literal: true require "concurrent/array" require "concurrent/timer_task" -require "concurrent/executor/thread_pool_executor" +require "concurrent/executor/single_thread_executor" require "pakyow/support/message_verifier" require "pakyow/realtime/websocket" @@ -18,14 +18,11 @@ def initialize(adapter = :memory, adapter_config, timeout_config) require "pakyow/realtime/server/adapters/#{adapter}" @adapter = Adapters.const_get(adapter.to_s.capitalize).new(self, adapter_config) @sockets = Concurrent::Array.new @timeout_config = timeout_config - @executor = Concurrent::ThreadPoolExecutor.new( - auto_terminate: false, - min_threads: 1, - max_threads: 10, - max_queue: 0 + @executor = Concurrent::SingleThreadExecutor.new( + auto_terminate: false ) connect rescue LoadError => e Pakyow.logger.error "Failed to load data subscriber store adapter named `#{adapter}'"