Installation
Initialization
Create an III client and connect to the engine. Blocks until the WebSocket connection is established and ready.Methods
connect_async
Connect to the III Engine via WebSocket. Initializes OpenTelemetry (if configured), attaches the event loop, and establishes the WebSocket connection. This is called automatically during construction — use it only if you need to reconnect manually from an async context. Signaturecreate_channel
Create a streaming channel pair for worker-to-worker data transfer. The returnedChannel contains a local writer / reader
and their serializable refs (writer_ref, reader_ref) that
can be passed as fields in invocation data to other functions.
Signature
Parameters
Example
create_channel_async
Create a streaming channel pair for worker-to-worker data transfer. The returnedChannel contains a local writer / reader
and their serializable refs (writer_ref, reader_ref) that
can be passed as fields in invocation data to other functions.
Signature
Parameters
Example
create_stream
Register a custom stream implementation, overriding the engine default. Registers 5 of the 6IStream methods (get, set, delete,
list, list_groups). The update method is not registered
— atomic updates are handled by the engine’s built-in stream update logic.
Signature
Parameters
Example
get_connection_state
Return the current WebSocket connection state. Signatureregister_function
Register a function with the engine. Pass a handler for local execution, or anHttpInvocationConfig
for HTTP-invoked functions (Lambda, Cloudflare Workers, etc.).
Handlers can be synchronous or asynchronous. Sync handlers are
automatically wrapped with run_in_executor so they do not
block the event loop. Each handler receives a single data
argument containing the trigger payload.
request_format and response_format are auto-extracted
from the handler’s type hints when omitted or passed as None
(the default). To opt out of auto-extraction, pass an explicit
schema (RegisterFunctionFormat or dict). This behavior
is Python-specific — the Node SDK does not auto-extract from TS
types, because TypeScript types are erased at runtime.
Signature
Parameters
Example
register_service
Register a logical service grouping with the engine. Services provide an organisational hierarchy for functions. A service can optionally reference aparent_service_id to form
a tree visible in the console.
Signature
Parameters
Example
register_trigger
Bind a trigger configuration to a registered function. SignatureParameters
Example
register_trigger_type
Register a custom trigger type with the engine. Returns a :class:TriggerTypeRef handle with register_trigger
and register_function methods.
Signature
Parameters
Example
shutdown
Gracefully shut down the client, releasing all resources. Cancels any pending reconnection attempts, rejects all in-flight invocations with an error, closes the WebSocket connection, and stops the background event-loop thread. After this call the instance must not be reused. SignatureExample
shutdown_async
Gracefully shut down the client, releasing all resources. Cancels any pending reconnection attempts, rejects all in-flight invocations with an error, closes the WebSocket connection, and stops the background event-loop thread. After this call the instance must not be reused. SignatureExample
trigger
Invoke a remote function. The routing behavior and return type depend on theaction field:
- No action: synchronous — waits for the function to return.
TriggerAction.Enqueue(...): async via named queue — returnsEnqueueResult.TriggerAction.Void(): fire-and-forget — returnsNone.
Parameters
Example
trigger_async
Invoke a remote function. The routing behavior and return type depend on theaction field:
- No action: synchronous — waits for the function to return.
TriggerAction.Enqueue(...): async via named queue — returnsEnqueueResult.TriggerAction.Void(): fire-and-forget — returnsNone.
Parameters
Example
unregister_trigger_type
Unregister a previously registered trigger type. SignatureParameters
Example
Logger
Structured logger that emits logs as OpenTelemetry LogRecords. Every log call automatically captures the active trace and span context, correlating your logs with distributed traces without any manual wiring. When OTel is not initialized, Logger gracefully falls back to Pythonlogging.
Pass structured data as the second argument to any log method. Using a
dict of key-value pairs (instead of string interpolation) lets you
filter, aggregate, and build dashboards in your observability backend.
debug
Log a debug-level message. SignatureParameters
Example
error
Log an error-level message. SignatureParameters
Example
info
Log an info-level message. SignatureParameters
Example
warn
Log a warning-level message. SignatureParameters
Example
Types
InitOptions · ReconnectionConfig · TelemetryOptions · HttpInvocationConfig · RegisterFunctionFormat · RegisterServiceInput · RegisterTriggerInput · RegisterTriggerTypeInput · TriggerActionEnqueue · TriggerActionVoid · TriggerRequest · IStream · OtelConfig · TriggerHandler
InitOptions
Options for configuring the III SDK.ReconnectionConfig
Configuration for WebSocket reconnection behavior.TelemetryOptions
Telemetry metadata to be reported to the engine.HttpInvocationConfig
Config for HTTP external function invocation.RegisterFunctionFormat
Format definition for function parameters.RegisterServiceInput
Input for registering a service (matches Node SDK’s RegisterServiceInput).RegisterTriggerInput
Input for registering a trigger (matches Node SDK’s RegisterTriggerInput).RegisterTriggerTypeInput
Input for registering a trigger type.TriggerActionEnqueue
Routes the invocation through a named queue for async processing.TriggerActionVoid
Fire-and-forget routing. No response is returned.TriggerRequest
Request object fortrigger().