class

PlaceOS::Core::ModuleManager

Inherits PlaceOS::Core::ProcessCheck < PlaceOS::Resource < Reference < Object

Constants

REDIS_VERSION_CHANNEL = "cluster/cluster_version"

Redis channel that cluster leader publishes stable cluster versions to

Constructors

instance

Singleton configured from environment

Source
new(uri : String | URI, clustering : Clustering | Nil = nil)

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
Source

Class methods

core_uri(mod : Model::Module | String, rendezvous_hash : RendezvousHash)
Source
execute_payload(method : String | Symbol, args : Enumerable | Nil = nil, named_args : Hash | NamedTuple | Nil = nil)
Source
hash_id(mod : String | Model::Module)

Route via edge_id if the Module is on an Edge, otherwise the Module's id

Source
needs_restart?(mod : Model::Module) : Bool
Source
start_payload(mod : Model::Module)
Source
uri=(uri : URI)
Source

Instance methods

clustering
Source
discovery
Source
edge_processes

Manager for remote edge module processes

Source
load_module(mod : Model::Module, rendezvous_hash : RendezvousHash = discovery.rendezvous)

Load the module if current node is responsible

Source
local_processes

Manager for local module processes

Source
manage_edge(*args, **options)
Source
manage_edge(*args, **options, &)
Source
on_managed_edge?(mod : Model::Module)

Determine if a module is an edge module and allocated to the current core node.

Source
own_node?(*args, **options)
Source
own_node?(*args, **options, &)
Source
path_for?(*args, **options)
Source
path_for?(*args, **options, &)
Source
process_manager(mod : Model::Module | String, & : ProcessManager -> )

Delegate Model::Module to a ProcessManager, either local or on an edge

Source
process_manager(driver_key : String, edge_id : String | Nil) : ProcessManager | Nil
Source
process_resource(action : Resource::Action, resource mod : Model::Module) : Resource::Result
Source
publish_version(cluster_version : String)

Publish cluster version to redis

Source
refresh_module(mod : Model::Module)

Update/start modules with new configuration

Source
reload_modules(driver : Model::Driver) : Path | Nil

Stops modules on stale driver and starts them on the new driver

Returns the stale driver path

Source
restart_module(mod : Model::Module)
Source
stabilize(rendezvous_hash : RendezvousHash) : Bool

Run through modules and load to a stable state.

Uses a semaphore to ensure intermediary cluster events don't trigger stabilization.

Source
start(timeout : Time::Span = LOAD_TIMEOUT)
Source
start_module(mod : Model::Module)
Source
started?
Source
stop
Source
stop_module(mod : Model::Module)

Stop module on node

Source
unload_module(mod : Model::Module)

Stop and unload the module from node

Source