class PlaceOS::Core::ModuleManager
- PlaceOS::Core::ModuleManager
- PlaceOS::Resource(PlaceOS::Model::Module)
- Reference
- Object
Included Modules
Defined in:
placeos-core/module_manager.crConstant Summary
-
REDIS_VERSION_CHANNEL =
"cluster/cluster_version"
-
Redis channel that cluster leader publishes stable cluster versions to
Constructors
-
.instance : ModuleManager
Singleton configured from environment
-
.new(uri : String | URI, clustering : Clustering | Nil = nil)
Start up process is as follows..
Class Method Summary
- .core_uri(mod : Model::Module | String, rendezvous_hash : RendezvousHash)
- .execute_payload(method : String | Symbol, args : Enumerable | Nil = nil, named_args : Hash | NamedTuple | Nil = nil)
-
.hash_id(mod : String | Model::Module)
Route via
edge_id
if the Module is on an Edge, otherwise the Module's id - .needs_restart?(mod : Model::Module) : Bool
- .start_payload(mod : Model::Module)
- .uri : URI
- .uri=(uri : URI)
Instance Method Summary
- #clustering : Clustering
- #discovery : Clustering::Discovery
-
#edge_processes : Edge::Server
Manager for remote edge module processes
-
#load_module(mod : Model::Module, rendezvous_hash : RendezvousHash = discovery.rendezvous)
Load the module if current node is responsible
-
#local_processes : ProcessManager::Local
Manager for local module processes
- #manage_edge(*args, **options)
- #manage_edge(*args, **options, &)
-
#on_managed_edge?(mod : Model::Module)
Determine if a module is an edge module and allocated to the current core node.
- #own_node?(*args, **options)
- #own_node?(*args, **options, &)
- #path_for?(*args, **options)
- #path_for?(*args, **options, &)
-
#process_manager(mod : Model::Module | String, & : ProcessManager -> )
Delegate
Model::Module
to aProcessManager
, either local or on an edge - #process_manager(driver_key : String, edge_id : String | Nil) : ProcessManager | Nil
- #process_resource(action : Resource::Action, resource mod : Model::Module) : Resource::Result
-
#publish_version(cluster_version : String)
Publish cluster version to redis
-
#refresh_module(mod : Model::Module)
Update/start modules with new configuration
-
#reload_modules(driver : Model::Driver) : Path | Nil
Stops modules on stale driver and starts them on the new driver
- #restart_module(mod : Model::Module)
-
#stabilize(rendezvous_hash : RendezvousHash) : Bool
Run through modules and load to a stable state.
- #start(timeout : Time::Span = LOAD_TIMEOUT)
- #start_module(mod : Model::Module)
- #started? : Bool
- #stop
-
#stop_module(mod : Model::Module)
Stop module on node
-
#unload_module(mod : Model::Module)
Stop and unload the module from node
Constructor Detail
Start up process is as follows..
- registered
- consist hash all modules to determine loadable modules
- lazily start the driver processes
- launch the modules on those processes etc
- once load complete, mark in etcd that load is complete
Class Method Detail
Route via edge_id
if the Module is on an Edge, otherwise the Module's id
Instance Method Detail
Load the module if current node is responsible
Determine if a module is an edge module and allocated to the current core node.
Delegate Model::Module
to a ProcessManager
, either local or on an edge
Stops modules on stale driver and starts them on the new driver
Returns the stale driver path
Run through modules and load to a stable state.
Uses a semaphore to ensure intermediary cluster events don't trigger stabilization.