Skip to main content

Module process

Module process 

Source
Expand description

One dialect registry per process.

Razeri resolves platforms by name in hundreds of places — every renderer, every face, every binding — and until now each of those calls built a fresh registry from the dialects linked into the binary. That was correct and it was also a closed door: a dialect loaded from a shared library at run time landed in whichever builder loaded it, and nothing that resolved by name ever looked there.

This module holds the one registry those calls now read. It is built once, from the linked dialects plus whatever a plugin directory contributes, and it never changes afterwards. Two consequences follow, and both are the point:

  • A plugin loaded here is visible everywhere. The command line’s --target, the materialization core three calls deeper, and a Python caller in another process entirely all resolve through the same registry.
  • The directory is chosen before the first resolution, or not at all. A registry that could change under a running process would let two halves of one render disagree about what a name means. So the directory is installed first — explicitly by a host that has one, or from RAZERI_PLUGIN_DIR when the first resolution happens — and a later attempt to install a different one is refused rather than honoured.

Only dialects live here. A plugin may also register storage providers, language renderers and model adapters, and those still reach only the builder that loaded them; the process-wide registry grows to hold them when something resolves them by name the way dialects are resolved.

Structs§

PluginDirReport
What loading a plugin directory produced, kept for the life of the process so a face can report it — which library loaded, which was refused, and why.

Enums§

InstallError
Why an explicit installation was refused.

Constants§

PLUGIN_DIR_ENV
The environment variable that names a directory of plugin shared libraries.

Functions§

install_plugin_dir
Install a plugin directory as the one this process loads from, and build the registry now.
plugin_dir_from_environment
The directory PLUGIN_DIR_ENV names, if it is set to anything.
plugin_dir_report
The report from whichever directory this process loaded, if any.
process_registry
The registry every by-name resolution in this process reads.