Skip to main content

Overview

The III SDK provides methods to invoke functions synchronously (awaiting a response) or asynchronously (fire-and-forget).

Synchronous Invocation

call

Invoke a function and await the response.
str
required
The function ID to invoke
Any
required
Data to pass to the function (typically a dict)
float
Timeout in seconds. Raises TimeoutError if exceeded
Any
The function’s return value

Error Handling

Exceptions from the remote function are propagated to the caller:

Timeout Errors

Custom Timeout

Override the default timeout on a per-call basis:

Asynchronous Invocation

call_void

Invoke a function without waiting for a response (fire-and-forget).
str
required
The function ID to invoke
Any
required
Data to pass to the function

Use Cases

call_void is ideal for:
  • Notifications: Sending emails, SMS, push notifications
  • Logging: Fire-and-forget audit logs
  • Background tasks: Queue jobs that don’t need immediate results
  • Event broadcasting: Notify multiple subscribers

Aliases

trigger

Alias for call(). Both methods are equivalent:

trigger_void

Alias for call_void(). Both methods are equivalent:

Distributed Tracing

The SDK automatically propagates OpenTelemetry trace context across function calls when OTel is initialized:
Trace context is propagated via W3C Trace Context headers (traceparent and baggage).

Channel References

The SDK automatically resolves StreamChannelRef objects into ChannelReader or ChannelWriter instances:

Example: Request-Response Pattern

Example: Event-Driven Architecture