Skip to main content

init()

Initialize a new III SDK instance and connect to the engine.
string
required
WebSocket URL of the III Engine (e.g., ws://localhost:49199)
InitOptions
Optional configuration for the SDK instance
ISdk
An initialized III SDK instance

Example

Connection Management

getConnectionState()

Get the current connection state.
IIIConnectionState
Current connection state: 'disconnected' | 'connecting' | 'connected' | 'reconnecting' | 'failed'

onConnectionStateChange()

Register a callback to be notified of connection state changes.
(state: IIIConnectionState) => void
required
Function called when connection state changes
() => void
Function to unregister the callback

Example: Connection State Handling

Lifecycle Management

shutdown()

Gracefully shutdown the SDK, cleaning up all resources.
This method:
  • Stops all metrics reporting
  • Flushes and shuts down OpenTelemetry
  • Rejects all pending invocations
  • Closes the WebSocket connection
  • Clears all callbacks

Example: Graceful Shutdown

Engine Queries

listFunctions()

List all functions registered across the III network.
FunctionInfo[]
Array of registered function information

listWorkers()

List all workers connected to the engine.
WorkerInfo[]
Array of connected worker information

Example: Service Discovery