Sha256: fabe8faf83282f884b27a107f3b699bf75d7d3a2d11bd45dd567d0f09f83d1cd

Contents?: true

Size: 1.54 KB

Versions: 7

Compression:

Stored size: 1.54 KB

Contents

# frozen_string_literal: true

require "pakyow/framework"

require "pakyow/application/helpers/realtime/broadcasting"
require "pakyow/application/helpers/realtime/subscriptions"
require "pakyow/application/helpers/realtime/socket"

require "pakyow/application/config/realtime"
require "pakyow/application/behavior/realtime/serialization"
require "pakyow/application/behavior/realtime/server"
require "pakyow/application/behavior/realtime/silencing"

require "pakyow/presenter/renderer/behavior/realtime/install_websocket"

module Pakyow
  module Realtime
    class Framework < Pakyow::Framework(:realtime)
      def boot
        object.class_eval do
          register_helper :active, Application::Helpers::Realtime::Broadcasting
          register_helper :active, Application::Helpers::Realtime::Subscriptions
          register_helper :passive, Application::Helpers::Realtime::Socket

          # Socket events are triggered on the app.
          #
          events :join, :leave

          include Application::Config::Realtime
          include Application::Behavior::Realtime::Server
          include Application::Behavior::Realtime::Silencing
          include Application::Behavior::Realtime::Serialization

          isolated :Renderer do
            include Presenter::Renderer::Behavior::Realtime::InstallWebsocket
          end

          isolated :Connection do
            after "initialize" do
              set(:__socket_client_id, params[:socket_client_id] || Support::MessageVerifier.key)
            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/realtime/framework.rb
pakyow-realtime-1.0.5 lib/pakyow/realtime/framework.rb
pakyow-realtime-1.0.4 lib/pakyow/realtime/framework.rb
pakyow-realtime-1.0.3 lib/pakyow/realtime/framework.rb
pakyow-realtime-1.0.2 lib/pakyow/realtime/framework.rb
pakyow-realtime-1.0.1 lib/pakyow/realtime/framework.rb
pakyow-realtime-1.0.0 lib/pakyow/realtime/framework.rb