ablative docs
↑↓ move↵ openesc close
Stack Notebook ablative.com.au

Create namespaces

Create a durable namespace explicitly when automatic creation is closed.

Open .md

Close automatic creation

Merge these settings into the matching sections of the server config. Retain its outbox transport and durable store settings.

The default ceiling is 1024. It caps claimed outbox rows for parallel and collect members only while the outbox is enabled. Ordinary calls bypass it, and accepted worker tasks can continue executing after their rows are marked done.

[namespaces]
default = "default"
auto_create = "closed"
max_in_flight_activities = 1024

# Enable the claim ceiling for parallel and collect members.
[outbox]
enabled = true
Run-wide worker cancellation
On main, crates/aion-server/src/worker/cancel_cascade_hook.rs:150 invokes cancellation for the ended run; worker/activity_cancel.rs:268–284 sends each gRPC CancelActivity frame. These frames serve run-wide cancellation, rather than a public single-activity route.
Quota commissioning
On main, crates/aion-server/src/run/outbox_commission.rs:160–162 skips a disabled outbox; lines 212–231 install namespace backpressure only on the enabled dispatcher.
Counted dispatches
On main, crates/aion/src/runtime/nif_collect.rs:306–316 stages parallel/collect members through the outbox. runtime/nif_activity_dispatch.rs:448 dispatches an ordinary call directly, outside that count.
Defaults
On main, crates/aion-server/src/config/defaults.rs:33 sets the namespace ceiling to 1024. config/sections.rs:940–945 defaults outbox.enabled to false; crates/aion-server/templates/first-run-config.toml:77 enables it.
Cluster share
On main, crates/aion-server/src/worker/backpressure.rs computes ceil(namespace quota × owned shards / total shards). Rounding can put aggregate claimed capacity slightly above the nominal quota.
Handoff and execution
On main, crates/aion-server/src/worker/outbox_dispatcher.rs:650–677 marks a successfully handed-off row done. worker/dispatch.rs:308–319 defines dispatch success as placement with a worker. The claim ceiling therefore bounds claimed rows; worker concurrency bounds executing handler slots.

Create the namespace

Use a bearer whose grants include the requested namespace. Set the HTTP endpoint and token process settings for your deployment. The example creates a namespace named payments.

curl --fail-with-body -sS -X POST "${AION_HTTP_ENDPOINT:-http://127.0.0.1:8080}/namespaces" \
  -H "authorization: Bearer $AION_TOKEN" \
  -H 'content-type: application/json' \
  --data-binary '{"name":"payments"}'
POST /namespaces
JSON body {"name":"payments"}. The server trims surrounding whitespace and refuses an empty name. The caller needs access to that namespace.
Response
JSON name plus created: true on creation, false when the durable namespace already exists. Repeating the same authorized call is idempotent.
Implementation
crates/aion-server/src/api/http/workflows.rs:412–465 authorizes the name and calls NamespaceMinter.create_explicit, including when auto_create is closed.

Read it back

The list and records endpoints show only namespaces the caller can access. Records include the durable namespace settings.

curl --fail-with-body -sS -X GET "${AION_HTTP_ENDPOINT:-http://127.0.0.1:8080}/namespaces" \
  -H "authorization: Bearer $AION_TOKEN"
curl --fail-with-body -sS -X GET "${AION_HTTP_ENDPOINT:-http://127.0.0.1:8080}/namespaces/records" \
  -H "authorization: Bearer $AION_TOKEN"

Pass the same namespace when deploying, starting workflows and registering workers. See auth and Lys for grants and worker operations for queue admission.