Registration
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
- Graph
-
- Supertypes
-
trait AutoCloseableclass Objecttrait Matchableclass Any