class PlaceOS::Api::WebSocket::Session
- PlaceOS::Api::WebSocket::Session
- Reference
- Object
Defined in:
placeos-rest-api/websocket/session.crConstant Summary
-
Log =
::Log.for(self)
Constructors
Class Method Summary
-
.binding_key(system_id, module_name, index, name)
Index into module websocket sessions
-
.cache_key(system_id, module_name, index)
Index into module_id cache
-
.subscriptions : Driver::Proxy::Subscriptions
Class level subscriptions to modules
Instance Method Summary
-
#bind(request_id : Int64, system_id : String, module_name : String, index : Int32, name : String)
Bind a websocket to a module subscription
-
#cleanup
Shutdown handler
-
#debug(request_id : Int64, system_id : String, module_name : String, index : Int32, name : String)
Attach websocket to debug output of a module
-
#delete_binding(system_id, module_name, index, name)
Create a binding to a module on the Session
-
#exec(request_id : Int64, system_id : String, module_name : String, index : Int32, name : String, args : Array(JSON::Any) | Nil)
Grab core url for the module and dial an exec request
-
#has_binding?(system_id, module_name, index, name)
Check for existing binding to a module
-
#ignore(request_id : Int64, system_id : String, module_name : String, index : Int32, name : String)
Detach websocket from module debug output
-
#metadata?(system_id, module_name, index) : Driver::DriverModel::Metadata | Nil
Looks up the metadata.
-
#module_id?(system_id, module_name, index) : String | Nil
Looks up the module_id - checks for fresh value in cache - refreshes cache with new value if present
-
#notify_update(value, request_id, system_id, module_name, index, status)
Parse an update from a subscription and pass to listener
-
#parse_request(data) : Request | Nil
Ensures - required params present - command recognised
-
#unbind(request_id : Int64, system_id : String, module_name : String, index : Int32, name : String)
Unbind a websocket from a module subscription
Constructor Detail
Class Method Detail
Instance Method Detail
Bind a websocket to a module subscription
Attach websocket to debug output of a module
Create a binding to a module on the Session
Grab core url for the module and dial an exec request
Detach websocket from module debug output
Looks up the metadata.
- checks for fresh value in cache
- refreshes cache with new value if present
Looks up the module_id
- checks for fresh value in cache
- refreshes cache with new value if present
Parse an update from a subscription and pass to listener
Ensures
- required params present
- command recognised
Unbind a websocket from a module subscription