Enhanced comprehensive example to wait for AppInstance deployment completion: ## New Polling Features: - **State Monitoring**: Polls ShowAppInst every 10 seconds until ready - **Timeout Protection**: 5-minute maximum wait time with context cancellation - **Smart State Detection**: Handles Creating, Ready, Running, Error states - **Progress Feedback**: Real-time status updates during deployment ## Implementation Details: - **waitForInstanceReady()**: Robust polling function with timeout - **State Logic**: Exits on non-creating states (Ready, Running, Error) - **Error Handling**: Distinguishes between polling errors and failure states - **Context Management**: Proper timeout context with cleanup ## User Experience: ``` 5️⃣ Waiting for application instance to be ready... Polling instance state (timeout: 5 minutes)... 📊 Instance state: Creating 📊 Instance state: Creating (power: PowerOn) 📊 Instance state: Ready (power: PowerOn) ✅ Instance reached ready state: Ready ``` This ensures the example demonstrates a complete, realistic deployment workflow where instance creation is fully completed before proceeding to subsequent operations. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
8.4 MiB
Executable file
8.4 MiB
Executable file