Skip to main content

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. Signature

create_channel

Create a streaming channel pair for worker-to-worker data transfer. The returned Channel 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 returned Channel 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 6 IStream 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. Signature

list_functions

List all functions registered with the engine across all workers. Signature

Example

list_functions_async

List all functions registered with the engine across all workers. Signature

Example

list_triggers

List all triggers registered with the engine. Signature

Parameters

Example

list_triggers_async

List all triggers registered with the engine. Signature

Parameters

Example

list_workers

List all workers currently connected to the engine. Signature

Example

list_workers_async

List all workers currently connected to the engine. Signature

Example

on_functions_available

Subscribe to function-availability events from the engine. The callback fires whenever the set of available functions changes (e.g. a new worker connects or a function is unregistered). Signature

Parameters

Example

register_function

Register a function with the engine. Pass a handler for local execution, or an HttpInvocationConfig 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. When func_or_id is a str, the simplified API is used: request_format and response_format are auto-extracted from the handler’s type hints when not explicitly provided. 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 a parent_service_id to form a tree visible in the engine dashboard. Signature

Parameters

Example

register_trigger

Bind a trigger configuration to a registered function. Signature

Parameters

Example

register_trigger_type

Register a custom trigger type with the engine. 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. Signature

Example

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. Signature

Example

trigger

Invoke a remote function. The routing behavior and return type depend on the action field:
  • No action: synchronous — waits for the function to return.
  • TriggerAction.Enqueue(...): async via named queue — returns EnqueueResult.
  • TriggerAction.Void(): fire-and-forget — returns None.
Signature

Parameters

Example

trigger_async

Invoke a remote function. The routing behavior and return type depend on the action field:
  • No action: synchronous — waits for the function to return.
  • TriggerAction.Enqueue(...): async via named queue — returns EnqueueResult.
  • TriggerAction.Void(): fire-and-forget — returns None.
Signature

Parameters

Example

unregister_trigger_type

Unregister a previously registered trigger type. Signature

Parameters

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 Python logging. 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. Signature

Parameters

Example

error

Log an error-level message. Signature

Parameters

Example

info

Log an info-level message. Signature

Parameters

Example

warn

Log a warning-level message. Signature

Parameters

Example

Types

InitOptions · ReconnectionConfig · TelemetryOptions · HttpInvocationConfig · RegisterFunctionFormat · RegisterFunctionInput · 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.

RegisterFunctionInput

Input for registering a function — matches Node.js RegisterFunctionInput.

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 (matches Node SDK’s RegisterTriggerTypeInput).

TriggerActionEnqueue

Routes the invocation through a named queue for async processing.

TriggerActionVoid

Fire-and-forget routing. No response is returned.

TriggerRequest

Request object for trigger().

IStream

Abstract interface for stream operations.

OtelConfig

Configuration for OpenTelemetry initialization.

TriggerHandler

Abstract base class for trigger handlers.