Class: Rapid::Server::WebSocketUpdater

Inherits:
Updater
  • Object
show all
Defined in:
lib/ury_rapid/server/updater.rb

Overview

An Updater that sends updates to a sinatra-websocket WebSocket

Instance Method Summary collapse

Methods inherited from Updater

launch, #run

Constructor Details

#initialize(model, in_websocket, authenticator, init_privileges) ⇒ WebSocketUpdater

Initialises a WebSocketUpdater

Examples:

Initialise a WebSocketUpdater.

WebSocketUpdater.new(model, websocket, authenticator, privs)

Parameters:

  • model (Model)

    The model to which this Updater will subscribe for updates.

  • in_websocket (Object)

    The WebSocket to which this Updater will send updates, and from which this Updater will receive requests.

  • authenticator (Object)

    An object providing authentication services, to be used for authenticating on the WebSocket.

  • init_privileges (Object)

    The initial set of privileges to give to this Updater. These may be replaced by the client by sending an authentication request.


153
154
155
156
157
158
# File 'lib/ury_rapid/server/updater.rb', line 153

def initialize(model, in_websocket, authenticator, init_privileges)
  super(model)
  @privileges = init_privileges
  @authenticator = authenticator
  @websocket = in_websocket
end