call()
Invoke a function and wait for the result.string
required
ID of the function to invoke (e.g.,
'users::create')TInput
required
Input data to pass to the function
number
Optional timeout in milliseconds. Defaults to
invocationTimeoutMs from init() options (120000ms / 2 minutes)TOutput
The function’s return value
Example: Basic Call
Example: With Timeout
Example: Type-Safe Calls
callVoid()
Invoke a function asynchronously without waiting for a response (fire-and-forget).string
required
ID of the function to invoke
TInput
required
Input data to pass to the function
callVoid() returns immediately and does not wait for the function to complete. Use this for background tasks, logging, notifications, etc.Example: Fire-and-Forget
Example: Background Processing
trigger() / triggerVoid()
Aliases forcall() and callVoid() for backward compatibility:
Error Handling
Function invocations can fail for various reasons. Always handle errors appropriately:Common Error Messages
Invocation timeout
Invocation timeout
Function not found
Function not found
Invocation failed
Invocation failed
iii is shutting down
iii is shutting down
Distributed Tracing
All invocations automatically propagate W3C trace context for distributed tracing:- Service A starts a span
- Service A calls Service B
- Service B receives the trace context and creates a child span
- Both spans are linked in the distributed trace
Channel Passing
Pass channel references in invocation data for streaming:Performance Tips
Use callVoid() for non-critical operations
Use callVoid() for non-critical operations
Set appropriate timeouts
Set appropriate timeouts
Parallelize independent calls
Parallelize independent calls
Handle errors gracefully
Handle errors gracefully
Best Practices
Always specify types
Always specify types
Use meaningful function IDs
Use meaningful function IDs
Set reasonable timeouts
Set reasonable timeouts