class PlaceOS::Driver::Proxy::RemoteDriver

Defined in:

placeos-driver/proxy/remote_driver.cr

Constant Summary

CORE_NAMESPACE = "core"

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(sys_id : String, module_name : String, index : Int32, discovery : Clustering::Discovery = RemoteDriver.default_discovery, user_id : String | Nil = nil, &edge_id : String -> String) #

[View source]
def self.new(module_id : String, sys_id : String, module_name : String, index : Int32 = 1, discovery : Clustering::Discovery = RemoteDriver.default_discovery, user_id : String | Nil = nil, &edge_id : String -> String) #

[View source]

Class Method Detail

def self.default_discovery : Clustering::Discovery #

[View source]
def self.get_parts(module_id : String | Symbol) : Tuple(String, Int32) #

Extract module name and module id from string e.g. "Display_3" => {"Display", 3} "Display" => {"Display", 1} "My_Display" => {"My_Display", 1}


[View source]

Instance Method Detail

def [](status) #

[View source]
def []?(status) #

[View source]
def debug(request_id : String | Nil = nil) #

Returns a websocket that sends debugging logging to the remote Each message consists of an array [0, "message"] Easiest way to parse is: Tuple(Logger::Severity, String).from_json(%([0, "test"]))


[View source]
def exec(security : Clearance, function : String, args = nil, named_args = nil, request_id : String | Nil = nil, user_id : String | Nil = @user_id) : Tuple(String, Int32) #

Executes a request against the appropriate core and returns the JSON result


[View source]
def function_present?(function : String) : Bool #

[View source]
def function_visible?(security : Clearance, function : String) #

[View source]
def index : Int32 #

[View source]
def metadata : DriverModel::Metadata | Nil #

[View source]
def metadata? : DriverModel::Metadata | Nil #

[View source]
def module_id : String | Nil #

[View source]
def module_id? : String | Nil #

[View source]
def module_name : String #

[View source]
def status(klass, key) #

[View source]
def status : RedisStorage #

[View source]
def status?(klass, key) #

[View source]
def subscribe(subscriptions : Proxy::Subscriptions, status, &callback : Driver::Subscriptions::IndirectSubscription, String -> Nil) : Driver::Subscriptions::IndirectSubscription #

All subscriptions to external drivers should be indirect as the driver might be swapped into a completely different system - whilst we've looked up the id of this instance of a driver, it's expected that this object is short lived


[View source]
def sys_id : String #

[View source]
def which_core(hash_id : String) : URI #

Use consistent hashing to determine location of a resource


[View source]
def which_core : URI #

Use consistent hashing to determine the location of the module


[View source]