Sha256: 563968104b19f05e8cd6e0462ddc683a4cb7d15fd79d3f0c4a8fccd6dac5f946

Contents?: true

Size: 1.17 KB

Versions: 7

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true

require "pakyow/support/extension"

module Pakyow
  class Application
    module Config
      module Realtime
        extend Support::Extension

        apply_extension do
          configurable :realtime do
            setting :adapter_settings, {}
            setting :path, "pw-socket"
            setting :endpoint
            setting :log_initial_request, false

            defaults :production do
              setting :adapter_settings do
                { key_prefix: [Pakyow.config.redis.key_prefix, config.name].join("/") }
              end

              setting :log_initial_request, true
            end

            configurable :timeouts do
              # Give sockets 60 seconds to connect before cleaning up their state.
              #
              setting :initial, 60

              # When a socket disconnects, keep state around for 24 hours before
              # cleaning up. This improves the user experience in cases such as
              # when a browser window is left open on a sleeping computer.
              #
              setting :disconnect, 24 * 60 * 60
            end
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pakyow-realtime-1.0.6 lib/pakyow/application/config/realtime.rb
pakyow-realtime-1.0.5 lib/pakyow/application/config/realtime.rb
pakyow-realtime-1.0.4 lib/pakyow/application/config/realtime.rb
pakyow-realtime-1.0.3 lib/pakyow/application/config/realtime.rb
pakyow-realtime-1.0.2 lib/pakyow/application/config/realtime.rb
pakyow-realtime-1.0.1 lib/pakyow/application/config/realtime.rb
pakyow-realtime-1.0.0 lib/pakyow/application/config/realtime.rb