addgateway(dyn_lib_path)
addgateway(dyn_lib_path, mode)
addgateway(dyn_lib_path, module_name, mode)
| Parameter | Description |
|---|---|
| dyn_lib_path | a string: path of a dynamic library prepared for Nelson. |
| mode | a string: auto uses the gateway cache and lazy-loading when possible, loaded forces immediate loading. |
addgateway(dyn_lib_path) adds dynamically builtin at runtime.
The dynamic library must provide GetGatewayDescriptor and AddGateway.
By default, auto mode registers lazy builtins from the cache when possible. Use loaded to force the dynamic library to be loaded immediately.
Gateway descriptors are stored in one cache file, prefdir()/gateway_cache.json. Nelson rebuilds the cache entry automatically when the dynamic library changes.
Set NELSON_GATEWAY_TRACE=1 to print gateway cache and loading decisions. Set NELSON_GATEWAY_FORCE_LOADED=1 to force immediate loading for all gateways.
If gateway was already loaded, no error or warning will be raised.
addgateway(modulepath('time', 'builtin'), 'loaded')
| Version | Description |
|---|---|
| 1.0.0 | initial version |