Class: Pakyow::Realtime::Framework

Inherits:
Object
  • Object
show all
Defined in:
lib/pakyow/realtime/framework.rb

Instance Method Summary collapse

Instance Method Details

#bootObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/pakyow/realtime/framework.rb', line 19

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