BotRegistry
Central registry for all available search algorithms in the engine.
Attributes
- Source
- BotRegistry.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
BotRegistry.type
Members list
Type members
Classlikes
A live registration created by registerCustomBot. Closing it removes the entry from the registry and, if the registered algorithm is itself java.lang.AutoCloseable (e.g. an ONNX bot holding a native onnxruntime session), closes the algorithm too — pairing the two by construction instead of leaving the caller to remember both halves (#589).
A live registration created by registerCustomBot. Closing it removes the entry from the registry and, if the registered algorithm is itself java.lang.AutoCloseable (e.g. an ONNX bot holding a native onnxruntime session), closes the algorithm too — pairing the two by construction instead of leaving the caller to remember both halves (#589).
Closing is a no-op on the registry side if id has since been replaced by another registration: a stale handle carries its own registration token and can only remove the exact entry it created, never a newer one — even one that happens to share both the id and the algorithm instance (e.g. the same singleton bot registered twice). Removal is guarded by the same lock registerCustomBot writes under, so a concurrent registration and close cannot race on bots. Closing more than once is safe: only the first call removes the entry or closes algorithm.
Attributes
- Source
- BotRegistry.scala
- Supertypes
-
trait AutoCloseableclass Objecttrait Matchableclass Any
Value members
Concrete methods
Returns all available bots sorted by difficulty, including any registered via registerCustomBot.
Returns all available bots sorted by difficulty, including any registered via registerCustomBot.
Attributes
- Source
- BotRegistry.scala
Returns the default algorithm (Greedy).
Looks up a search algorithm by its bot ID.
Looks up a search algorithm by its bot ID.
Value parameters
- id
-
The bot ID to lookup (case-insensitive)
Attributes
- Returns
-
The algorithm if found, or None.
- Source
- BotRegistry.scala
Registers (or replaces) a bot at runtime under info.id, used to add decorator bots such as an OpeningBookBot supplied by a host application (the JS API's registerOpeningBookBot).
Registers (or replaces) a bot at runtime under info.id, used to add decorator bots such as an OpeningBookBot supplied by a host application (the JS API's registerOpeningBookBot).
The registry is a process-wide singleton. Writes are synchronized and bots is @volatile, so a registration is published safely to concurrent readers (availableBots / getAlgorithm) on the JVM; it is still intended for host setup (e.g. a JS worker boot) rather than a high-churn write path.
Value parameters
- algorithm
-
the search algorithm to register
- info
-
metadata for the bot;
info.idis the lookup key (lower-cased)
Attributes
- Returns
-
a Registration handle; close it (e.g. via scala.util.Using) to remove the entry and close
algorithmif it owns a closeable resource. Discarding the handle is equivalent to the old permanent-registration behavior. - Source
- BotRegistry.scala
Registers a host-configured TacticianSearch under an unused, case-insensitive id. Returns a removable registration on success, or None for a missing profile, blank identity or occupied id. Checking and installing the id happen under the same lock, so concurrent setup cannot replace an existing opponent.
Registers a host-configured TacticianSearch under an unused, case-insensitive id. Returns a removable registration on success, or None for a missing profile, blank identity or occupied id. Checking and installing the id happen under the same lock, so concurrent setup cannot replace an existing opponent.
There is no built-in profile: hosts supply the work limit and evaluation weights explicitly.
Attributes
- Source
- BotRegistry.scala