Skip to main content
POST
/
api
/
reload
Reload System
curl --request POST \
  --url https://api.example.com/api/reload
{
  "200": {},
  "500": {},
  "status": "<string>",
  "components_loaded": 123,
  "errors": [
    {}
  ]
}

Endpoint

POST /api/reload

Description

Reloads all WebAssembly components from the configured repository locations without restarting the TAHO host process. This allows you to deploy new versions of services or add new services without downtime.

Request

No request body required.

Response

status
string
Status message indicating reload success or failure
components_loaded
number
Number of components successfully loaded
errors
array
List of any errors encountered during reload

Examples

Basic Reload

curl -X POST http://localhost:9481/api/reload
Response
{
  "status": "success",
  "components_loaded": 5,
  "services": [
    "example.hello",
    "math.calculator",
    "ai.txt2img",
    "data.processor",
    "api.gateway"
  ]
}

Reload After Component Update

# 1. Update component in repository
cp target/wasm32-wasi/release/my_service.wasm /path/to/components/

# 2. Reload TAHO to pick up the new version
curl -X POST http://localhost:9481/api/reload
Response
{
  "status": "success",
  "components_loaded": 6,
  "newly_loaded": ["myapp.myservice"]
}

Handle Reload Errors

curl -X POST http://localhost:9481/api/reload
Response (with errors)
{
  "status": "partial",
  "components_loaded": 4,
  "errors": [
    {
      "component": "broken.service",
      "error": "Invalid WASM component format"
    }
  ]
}

Use Cases

Deploy New Service Version

# Build new version
cargo component build --release

# Copy to repository
cp target/wasm32-wasi/release/service.wasm /components/

# Hot-reload without downtime
curl -X POST http://localhost:9481/api/reload

Add New Service

# Deploy new component file to repository
# (via git push, file copy, or network deployment)

# Reload to discover and load the new component
curl -X POST http://localhost:9481/api/reload

Development Workflow

# Watch for changes and auto-reload
while inotifywait -e modify /path/to/components/*.wasm; do
  curl -X POST http://localhost:9481/api/reload
  echo "Components reloaded at $(date)"
done

Status Codes

200
Success
Reload completed (check response for partial failures)
500
Internal Server Error
Reload operation failed completely

Component Discovery

TAHO scans configured repositories for .wasm files:
config.toml
# Components are loaded from these locations
repo_urls = [
  "file:///usr/local/taho/components",
  "file:///home/user/my-components",
  "https://github.com/myorg/taho-components"
]
During reload:
  1. Each repository URL is scanned
  2. .wasm component files are discovered
  3. Components are compiled (if not cached)
  4. Services are registered and made available

Notes

  • Zero Downtime: Existing service instances continue running during reload
  • Caching: Previously compiled components use cached versions if unchanged
  • Repository Scan: All configured repositories are rescanned
  • Service Registration: New services become immediately available
  • Version Updates: Updated component versions replace old ones
  • Error Handling: Failed component loads are logged but don’t prevent other components from loading

Configuration

Configure reload behavior in config.toml:
# Component repository settings
repo_urls = ["file:///components"]
component_cache_size = 100  # Number of compiled components to cache

# Reload settings
[reload]
timeout_seconds = 30
parallel_loading = true
verify_signatures = false  # Future feature

See Also