The contract every portals_<language> package implements.
Core portals ships no worker SDKs. Each supported language lives in its
own Hex package (portals_python, portals_ruby, portals_javascript,
portals_php, portals_java, portals_go) that bundles its SDK under
priv/ and exposes a module implementing this behaviour:
sdk_path/0— where the bundled SDK lives on disk. It is resolved throughApplication.app_dir/2, so it is valid undermix run, in tests and inside amix release.worker_opts/1— expands language-specific options (a script, a main class, a binary) into the generic:command/:args/:envoptions understood byPortals.start_worker/1andPortals.start_pool/1, including whatever puts the SDK on that runtime's import path. Every other option passes through untouched.
Every package also sets PORTALS_SDK_PATH in the worker's environment,
as an escape hatch for scripts that need to locate the SDK themselves.
All packages are released in lockstep with portals, so a worker SDK
always speaks the protocol version the BEAM expects.
Summary
Callbacks
Absolute path to the SDK bundled in this package's priv/ directory.
Expand language-specific options into Portals.start_worker/1 options.
Functions
The supported languages and the package that provides each one.
The Portals.SDK module for language, raising with installation
instructions when its package is not a dependency of the current project.
Callbacks
@callback sdk_path() :: Path.t()
Absolute path to the SDK bundled in this package's priv/ directory.
Expand language-specific options into Portals.start_worker/1 options.
Functions
The supported languages and the package that provides each one.
iex> Portals.SDK.languages()["python"]
{Portals.Python, :portals_python}
The Portals.SDK module for language, raising with installation
instructions when its package is not a dependency of the current project.