class PlaceOS::Edge::Client

Included Modules

Defined in:

placeos-edge/client.cr

Constant Summary

Log = ::Log.for(self)
WEBSOCKET_API_PATH = "/api/engine/v2/edges/control"

Constructors

Instance Method Summary

Instance methods inherited from module PlaceOS::Core::ProcessManager::Common

debug(module_id : String, &on_message : DebugCallback) debug, driver_key_for?(module_id) : String | Nil driver_key_for?, driver_loaded?(driver_key : String) : Bool driver_loaded?, driver_status(driver_key : String) : DriverStatus | Nil driver_status, execute(module_id : String, payload : String | IO, user_id : String | Nil) execute, ignore(module_id : String, &on_message : DebugCallback)
ignore(module_id : String) : Array(DebugCallback)
ignore
, kill(driver_key : String) : Bool kill, loaded_modules : Hash(String, Array(String)) loaded_modules, module_loaded?(module_id : String) : Bool module_loaded?, path_for?(module_id) : Path | Nil path_for?, remove_driver_manager(key) remove_driver_manager, run_count : Count run_count, start(module_id : String, payload : String) start, stop(module_id : String) stop, system_status : SystemStatus system_status, unload(module_id : String) unload

Macros inherited from module PlaceOS::Core::ProcessManager::Common

module_error(module_id, exception) module_error

Constructor Detail

def self.new(uri : URI = PLACE_URI, secret : String | Nil = nil, sequence_id : UInt64 = 0, skip_handshake : Bool = false, ping : Bool = true, store : PlaceOS::Core::DriverStore = Core::DriverStore.new) #

[View source]

Instance Method Detail

def add_binary(key : String, binary : IO) #

[View source]
def attempt_download(loaded_channel, key) #

[View source]
def connect(initial_socket : HTTP::WebSocket | Nil = nil, &) #

Initialize the WebSocket API

Optionally accepts a block called after connection has been established.


[View source]
def connect(initial_socket : HTTP::WebSocket | Nil = nil) #

Initialize the WebSocket API

Optionally accepts a block called after connection has been established.


[View source]
def debug(module_id : String) #

[View source]
def disconnect #

[View source]
def drivers #

List the driver binaries present on this client


[View source]
def fetch_binary(key : String) : IO | Nil #

[View source]
def forward_debug_message(module_id, message) #

[View source]
def handle_request(sequence_id : UInt64, request : Protocol::Server::Request) #

[View source]
def handshake #

[View source]
def host : String #

[View source]
def ignore(module_id : String) #

[View source]
def load(module_id, driver_key) #

Check for binary, request if it's not present Start the module with redis hooks


[View source]
def load_binaries(binaries : Array(String)) #

Kicks off downloading all the binaries


[View source]
def load_binary(key : String) : Channel(Nil) | Nil #

Load binary, first checking if present locally then fetch from core


[View source]
def modules #

List the modules running on this client


[View source]
def on_redis(action : Protocol::RedisAction, hash_id : String, key_name : String, status_value : String | Nil) #

Proxy a redis action via Core


[View source]
def on_setting(module_id : String, setting_name : String, setting_value : String) #

Proxy a settings write via Core


[View source]
def queue_start(module_id : String, payload : String) #

[View source]
def remove_binary(key : String) #

[View source]