Sha256: e388d81e7c3124f7c4b279c7ab676a23f356ec9c728ca201787d38437ac679ed

Contents?: true

Size: 730 Bytes

Versions: 5

Compression:

Stored size: 730 Bytes

Contents

# frozen_string_literal: true

require "pakyow/support/extension"

module Pakyow
  module UI
    module Behavior
      module Timeouts
        extend Support::Extension

        apply_extension do
          on :join do
            @connection.app.data.persist(@id)
          end

          on :leave do
            @connection.app.data.expire(@id, config.realtime.timeouts.disconnect)
          end

          isolated :Renderer do
            after "render" do
              # Expire subscriptions if the connection is never established.
              #
              @app.data.expire(presentables[:__socket_client_id], @app.config.realtime.timeouts.initial)
            end
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pakyow-ui-1.0.0.rc5 lib/pakyow/ui/behavior/timeouts.rb
pakyow-ui-1.0.0.rc4 lib/pakyow/ui/behavior/timeouts.rb
pakyow-ui-1.0.0.rc3 lib/pakyow/ui/behavior/timeouts.rb
pakyow-ui-1.0.0.rc2 lib/pakyow/ui/behavior/timeouts.rb
pakyow-ui-1.0.0.rc1 lib/pakyow/ui/behavior/timeouts.rb