You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**timeout**- Maximum duration to wait for the invoked function to complete. Default is no timeout. Use this to prevent long-running invocations from blocking execution indefinitely.
316
-
317
312
**serdes_payload**- Custom serialization/deserialization for the payload sent to the invoked function. If None, uses default JSON serialization.
318
313
319
314
**serdes_result**- Custom serialization/deserialization for the result returned from the invoked function. If None, uses default JSON serialization.
320
315
321
316
**tenant_id**- Optional tenant identifier for multi-tenant isolation. If provided, the invocation will be scoped to this tenant.
322
317
323
-
### Setting timeouts
324
-
325
-
Use the `Duration`class to set timeouts:
326
-
327
-
```python
328
-
from aws_durable_execution_sdk_python.config import Duration, InvokeConfig
**Name invoke operations**- Use the `name` parameter to identify invoke operations in logs and tests.
553
504
554
-
**Set appropriate timeouts**- Configure timeouts based on expected execution time. Don't set them too short or too long.
555
-
556
505
**Handle errors explicitly**- Catch and handle errors from invoked functions. Don't let them propagate unexpectedly.
557
506
558
507
**Keep payloads small**- Large payloads increase serialization overhead. Consider passing references instead of large data.
@@ -603,10 +552,6 @@ A: Yes, you can invoke the same function multiple times with different payloads
603
552
604
553
A: The `function_name` parameter accepts function names in the same account. For cross-account invocations, you need appropriate IAM permissions and may need to use function ARNs (check AWS documentation for cross-account Lambda invocations).
605
554
606
-
**Q: What's the maximum timeout I can set?**
607
-
608
-
A: The timeout is limited by Lambda's maximum execution time (15 minutes). However, durable functions can run longer by suspending and resuming.
609
-
610
555
**Q: Can I invoke functions in parallel?**
611
556
612
557
A: Not directly with`context.invoke()`. For parallel execution, consider using `context.parallel()`with steps that perform invocations, or invoke multiple functions sequentially.
@@ -615,10 +560,6 @@ A: Not directly with `context.invoke()`. For parallel execution, consider using
615
560
616
561
A: Use the `name` parameter to identify operations in logs. Check CloudWatch logs for both the calling and invoked functions.
617
562
618
-
**Q: What happens if I don't set a timeout?**
619
-
620
-
A: The invoke operation waits indefinitely for the invoked function to complete. It's recommended to set timeouts for better error handling.
621
-
622
563
**Q: What's the difference between context.invoke() and using boto3's Lambda client to invoke functions?**
623
564
624
565
A: When you use `context.invoke()`, the SDK suspends your durable function's execution while waiting for the result. This means you don't pay for Lambda compute time while waiting. With boto3's Lambda client, your function stays active and consumes billable compute time while waiting for the response. Additionally, `context.invoke()` automatically checkpoints the operation, handles errors durably, and integrates with the durable execution lifecycle.
0 commit comments