asobi_extension_reserved (asobi v0.72.5)
View SourceThe names core keeps for itself.
asobi_extensions:validate/1 refuses an owns/0 claim on anything in here,
so an extension cannot shadow a core table, a core Lua namespace, a core error
domain or a core job queue.
Every list is derived from the live core source rather than restated, so it cannot drift:
lua from
asobi_lua_surface:reserved_namespaces/0, the one place thegame.*vocabulary is written down.tables from every core
kura_schemamodule'stable/0, found the same way asobi finds an extension's schemas.queues from every core
shigoto_workermodule'squeue/0.rpc from the domains of
asobi_error:core_codes/0, plus the Lua namespaces. An RPC prefix and an error domain are the same token by construction ({"code": "quests.name_taken"}), so an extension owning thestorageprefix would mint codes inside core's closed code set.core_codes/0rather thancodes/0on purpose:codes/0includes the codes the installed extensions declare, and reserving those would tell an extension it may not claim the namespace it just claimed.
Deriving from modules costs one code:ensure_loaded/1 sweep over core's
module list. asobi_extensions only asks for it when at least one extension
is installed, so a node with none pays nothing.
schema_tables/1 and worker_queues/1 are the two derivation rules
themselves, exported over an arbitrary module list. asobi_extensions runs
them over an extension's modules to derive that extension's table and queue
claims, so core's names and an extension's names are found by the same rule
rather than by two that can disagree.
Summary
Functions
The namespace kinds an extension may claim in owns/0.
Core's reserved token set, per namespace kind.
Every table declared by a kura_schema module in this list.
Every queue declared by a shigoto_worker module in this list.
Types
Functions
-spec kinds() -> [kind(), ...].
The namespace kinds an extension may claim in owns/0.
-spec namespaces() -> #{kind() := [asobi_extension:token()]}.
Core's reserved token set, per namespace kind.
-spec schema_tables([module()]) -> [asobi_extension:token()].
Every table declared by a kura_schema module in this list.
-spec worker_queues([module()]) -> [asobi_extension:token()].
Every queue declared by a shigoto_worker module in this list.