Sha256: 27ac3d63c6d3bbdacf3785786f063416030482ee39a8969bd7aa07e882564bd8

Contents?: true

Size: 1.16 KB

Versions: 5

Compression:

Stored size: 1.16 KB

Contents

# frozen_string_literal: true

require "pakyow/support/extension"

module Pakyow
  module Realtime
    module Behavior
      module Config
        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

5 entries across 5 versions & 1 rubygems

Version Path
pakyow-realtime-1.0.0.rc5 lib/pakyow/realtime/behavior/config.rb
pakyow-realtime-1.0.0.rc4 lib/pakyow/realtime/behavior/config.rb
pakyow-realtime-1.0.0.rc3 lib/pakyow/realtime/behavior/config.rb
pakyow-realtime-1.0.0.rc2 lib/pakyow/realtime/behavior/config.rb
pakyow-realtime-1.0.0.rc1 lib/pakyow/realtime/behavior/config.rb