Commit be04364
committed
feat: Add ExecutionContext with durable execution ARN
Add immutable ExecutionContext dataclass to provide readonly access to
execution-level metadata. The context contains the durable execution ARN
which uniquely identifies the execution instance within AWS.
Changes:
- Create ExecutionContext frozen dataclass with durable_execution_arn field
- Add execution_context parameter to DurableContext constructor
- Update from_lambda_context() to create ExecutionContext from state
- Update create_child_context() to propagate execution_context
- Export ExecutionContext in public API
- Add create_test_context() helper in test files for easier instantiation
- Update all test files to use new helper function
The ExecutionContext is automatically created in from_lambda_context()
using the state's durable_execution_arn, keeping the API simple while
maintaining immutability and thread safety.
closes #2831 parent f93ddd4 commit be04364
5 files changed
Lines changed: 237 additions & 67 deletions
File tree
- src/aws_durable_execution_sdk_python
- tests
- operation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
77 | 92 | | |
78 | 93 | | |
79 | 94 | | |
| |||
218 | 233 | | |
219 | 234 | | |
220 | 235 | | |
| 236 | + | |
221 | 237 | | |
222 | 238 | | |
223 | 239 | | |
224 | 240 | | |
225 | 241 | | |
| 242 | + | |
226 | 243 | | |
227 | 244 | | |
228 | 245 | | |
| |||
245 | 262 | | |
246 | 263 | | |
247 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
248 | 268 | | |
249 | 269 | | |
250 | 270 | | |
| |||
254 | 274 | | |
255 | 275 | | |
256 | 276 | | |
| 277 | + | |
257 | 278 | | |
258 | 279 | | |
259 | 280 | | |
| |||
0 commit comments