default when you do not set one. Use a
non-default namespace when multiple tenants or projects must use the same worker name or function id
on one engine.
Set a worker namespace
The SDK selects the worker namespace in this order:
Use a non-empty string for a namespace. Leave the option out and the SDK reads
III_NAMESPACE
itself, then falls back to default; an absent option gives the same result as passing
process.env.III_NAMESPACE (os.environ.get("III_NAMESPACE"),
std::env::var("III_NAMESPACE").ok()). A null, a None, or any other non-string value is invalid
and fails in both the SDK and at the engine. In Go, leave out iii.WithNamespace instead: it
refuses a blank name, so iii.WithNamespace(os.Getenv("III_NAMESPACE")) fails when the variable is
unset.
SDK option
Use the explicit option when application code must select the namespace. The option has priority overIII_NAMESPACE.
- Node / TypeScript
- Python
- Rust
- Go
- Browser
Call a function in a namespace
Setnamespace on the call. The call resolves only in that namespace. Omit the field and the call
resolves in the caller’s own namespace, which is where a worker’s neighbours are. A worker with no
namespace of its own resolves in default.
- CLI
- Node / TypeScript
- Python
- Rust
- Go
function_not_found. The error lists other namespaces where the function id exists.
iii call --namespace <NS> calls a function in that namespace. Without the flag it resolves in
default: a CLI invocation has no namespace of its own to inherit.Observe a namespaced function
An observer resolves the function it observes like a call: thenamespace you give with the
function_id, else the observing worker’s namespace (engine::* and configuration::* resolve to
default). The target resolves the same way; name another namespace with the object form of the
target (Go: ObserverOptions.TargetNamespace).
Inspect namespaces
Every row fromengine::functions::list and engine::workers::list contains a namespace field.
The list functions return all namespaces.
Pass namespace to an info function for strict lookup:
engine::functions::info and engine::workers::info first use a default
entry. If no default entry exists, they resolve a name that exists in only one namespace. They
return an ambiguity when the name exists in multiple namespaces.
Handle a rejected registration
The engine sendsregistrationrejected when a live worker already owns the same identity in the
same namespace.
For a worker-name conflict, change the worker name or namespace. For a function conflict, remove the
duplicate function id or move one worker to another namespace.
For the wire fields and the exact conflict sequence, see
RegistrationRejected.
Configure RBAC for a namespace
Aniii-worker-manager expose_functions rule without a namespace applies to default only. Add
the exact namespace when the rule must expose a namespaced function. See
Namespace-scoped function rules.