ReconnectionConfig type controls how the III SDK reconnects to the engine when the WebSocket connection is lost.
Type Definition
- TypeScript
- Python
- Rust
Fields
Default Configuration
- TypeScript
- Python
- Rust
Usage Examples
Fast Reconnection
For local development or low-latency requirements:- TypeScript
- Python
- Rust
Limited Retries
For batch jobs or scripts that should fail fast:- TypeScript
- Python
- Rust
No Automatic Reconnection
For testing or manual connection management:- TypeScript
- Python
- Rust
Connection State Monitoring
You can monitor connection state changes to react to reconnection events:- TypeScript
- Python
- Rust
Behavior During Reconnection
Message Queueing
When the connection is lost:- Outgoing messages are queued in memory
- On reconnect, all registrations (functions, triggers, services) are re-sent
- Queued invocations are sent after reconnection
- Duplicate registrations are automatically deduplicated
Pending Invocations
Active function invocations during disconnect:- TypeScript/Python: Remain pending, will timeout if not completed within
invocationTimeoutMs - Rust: Subject to
max_pending_messageslimit, excess messages are dropped
State Preservation
- ✅ Function registrations
- ✅ Trigger registrations
- ✅ Service registrations
- ✅ Trigger type handlers
- ❌ Active WebSocket connections (channels)
- ❌ In-flight HTTP streaming responses
Best Practices
- Production environments: Use default config with infinite retries
- Development: Reduce delays for faster feedback
- Batch jobs: Limit retries to fail fast
- High-traffic: Increase
jitterFactorto prevent thundering herd - Monitoring: Always monitor connection state in production