class Mosquito::Api::ExecutorConfig

Overview

Provides read/write access to the remotely stored executor count used by overseers configured with a stable overseer_id.

Supports both global counts (shared by all overseers) and per-overseer counts for asymmetric hardware configurations.

config = Mosquito::Api::ExecutorConfig.instance
config.executor_count                                  # => global count or nil
config.executor_count(overseer_id: "gpu-worker-1")     # => per-overseer count or nil
config.update(8)                                       # write global
config.update(2, overseer_id: "gpu-worker-1")          # write per-overseer
config.clear                                           # remove global override
config.clear(overseer_id: "gpu-worker-1")              # remove per-overseer override

Defined in:

mosquito/api/executor_config.cr

Constant Summary

CONFIG_KEY = "executor_count"

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.instance : self #

Class Method Detail

def self.clear_executor_count(overseer_id : String) : Nil #

def self.clear_executor_count : Nil #

def self.resolve(overseer_id : String | Nil = nil) : Int32 | Nil #

Resolves the effective executor count for an overseer by checking per-overseer first, then global. Returns nil if neither is set.


def self.store_executor_count(count : Int32, overseer_id : String) : Nil #

def self.store_executor_count(count : Int32) : Nil #

def self.stored_executor_count(overseer_id : String) : Int32 | Nil #

def self.stored_executor_count : Int32 | Nil #

Instance Method Detail

def clear(overseer_id : String) : Nil #

Removes the executor count override for a specific overseer.


def clear : Nil #

Removes the global executor count override.


def executor_count(overseer_id : String) : Int32 | Nil #

Returns the executor count for a specific overseer, or nil if no override has been set for that overseer.


def executor_count : Int32 | Nil #

Returns the global executor count stored in the backend, or nil if no override has been set.


def update(count : Int32, overseer_id : String) : Nil #

Writes an executor count override for a specific overseer.


def update(count : Int32) : Nil #

Writes a global executor count override.