-
Notifications
You must be signed in to change notification settings - Fork 0
Chain invokes #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Chain invokes #162
Conversation
- Create a base implementation for chainedInvokeProcessor - Implement start, succeed and fail action processing - Augment observer for chained invoke events
Changes: - when registering a function as a handler for the chained invokes, the functions will be wrapped so that they don't need to be structurally different to what is deployed in Lambda.
|
🤖 Emulator PR Created A draft PR has been created with locked dependencies: ➡️ https://github.com/aws/aws-durable-execution-emulator/pull/37 The emulator will build binaries using the exact testing SDK commit locked in uv.lock. |
| ) | ||
|
|
||
| raise InvalidParameterValueException(msg_invoke_exists) | ||
| case OperationAction.SUCCEED | OperationAction.FAIL: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some validations missing:
ChainedInvokeOptions null check - validates that chainedInvokeOptions is provided when starting an invoke.
Cross-account validation - ensures the child Lambda function is in the same AWS account as the parent execution.
Cross-region validation - ensure the child Lambda function is in the same region as the parent.
Function ARN parsing and validation - validates it's properly formatted.
Lambda ARN resolution -resolve partial function names to fully qualified ARNs.
| self._scheduler.stop() | ||
|
|
||
| def register_handler( | ||
| self, function_name: str, handler: Callable, *, durable: bool = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_durable
typings for the Callable.
| event = json.loads(payload) if payload else None | ||
|
|
||
| # Call handler with event and a mock context (Lambda signature) | ||
| result = handler(event, None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a mocked context - I think there is a dummy LambdaContext in the code somewhere
| function_name: The name of the function to register | ||
| handler: The @durable_execution decorated handler | ||
| """ | ||
| import uuid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no inline imports
| # The scheduler continues to process wait timers, allowing child executions | ||
| # with context.wait() to complete properly | ||
| completed = self._executor.wait_until_complete( | ||
| output.execution_arn, timeout=900 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
presumably shouldn't hard-code that 900?
Issue #, if available:
Description of changes:
Dependencies
If this PR requires testing against a specific branch of the Python Language SDK (e.g., for unreleased changes), uncomment and specify the branch below. Otherwise, leave commented to use the main branch.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.