Skip to content

Add control mode with fallback for Elixir SDK#5

Open
vaurdan wants to merge 1 commit intomainfrom
feature/control-mode
Open

Add control mode with fallback for Elixir SDK#5
vaurdan wants to merge 1 commit intomainfrom
feature/control-mode

Conversation

@vaurdan
Copy link

@vaurdan vaurdan commented Feb 6, 2026

Summary

  • Add control mode that multiplexes exec operations over a single persistent WebSocket per sprite (/v1/sprites/{name}/control), matching Go/JS/Python SDK implementations
  • Opt-in via control_mode: true on the client; gracefully falls back to direct per-command WebSocket if the server returns 404
  • Per-sprite support flag cached in ETS to avoid repeated 404 attempts; connection pooling with checkout/checkin and auto-drain

Test plan

  • 11 unit tests for control mode (client flags, URL building, support caching)
  • E2E test passing for test123 (control supported — uses multiplexed WebSocket)
  • E2E test passing for test and test1234 (control not supported — falls back to direct WebSocket)
  • Full mix test suite passes (34/34, excluding pre-existing Sprites.hello test)

Control mode allows multiplexing exec operations over a single
persistent WebSocket per sprite (via /control endpoint), avoiding
the overhead of opening a new WebSocket per command.

Key features:
- Opt-in via control_mode: true on the client
- Graceful fallback to direct WebSocket on 404
- Per-sprite support caching via ETS to avoid repeated 404s
- Connection pooling with checkout/checkin and auto-drain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments