Class: Orchestrator::WebsocketManager
- Inherits:
-
Object
- Object
- Orchestrator::WebsocketManager
- Defined in:
- lib/orchestrator/websocket_manager.rb
Constant Summary collapse
- DECODE_OPTIONS =
{ symbolize_names: true }.freeze
- PARAMS =
[:id, :cmd, :sys, :mod, :index, :name, {args: [].freeze}.freeze].freeze
- REQUIRED =
[:id, :cmd, :sys, :mod, :name].freeze
- COMMANDS =
Set.new([:exec, :bind, :unbind, :debug, :ignore])
- ERRORS =
{ parse_error: 0, bad_request: 1, access_denied: 2, request_failed: 3, unknown_command: 4, system_not_found: 5, module_not_found: 6, unexpected_failure: 7 }.freeze
Instance Method Summary collapse
-
#initialize(ws, user) ⇒ WebsocketManager
constructor
A new instance of WebsocketManager.
Constructor Details
#initialize(ws, user) ⇒ WebsocketManager
Returns a new instance of WebsocketManager.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/orchestrator/websocket_manager.rb', line 7 def initialize(ws, user) @ws = ws @user = user @loop = ws.loop @bindings = ::ThreadSafe::Cache.new @stattrak = @loop.observer @notify_update = method(:notify_update) @logger = ::Orchestrator::Logger.new(@loop, user) @ws.progress method(:on_message) @ws.finally method(:on_shutdown) #@ws.on_open method(:on_open) @accessed = ::Set.new @access_log = ::Orchestrator::AccessLog.new @access_log.user_id = @user.id end |