diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0840d15..1f39829 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -34,6 +34,9 @@ jobs: - name: Verify vendored GLightbox run: python3 scripts/vendor_glightbox.py --check + + - name: Verify example references + run: python3 scripts/check_example_refs.py - name: Build documentation run: zensical build --clean diff --git a/examples/java/advanced/serialization/appropriate-types.java b/examples/java/advanced/serialization/appropriate-types.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/appropriate-types.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/callback-config.java b/examples/java/advanced/serialization/callback-config.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/callback-config.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/container-types.java b/examples/java/advanced/serialization/container-types.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/container-types.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/convert-to-dicts.java b/examples/java/advanced/serialization/convert-to-dicts.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/convert-to-dicts.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/custom-objects.java b/examples/java/advanced/serialization/custom-objects.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/custom-objects.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/custom-serdes.java b/examples/java/advanced/serialization/custom-serdes.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/custom-serdes.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/dataclasses.java b/examples/java/advanced/serialization/dataclasses.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/dataclasses.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/datetime-timezone.java b/examples/java/advanced/serialization/datetime-timezone.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/datetime-timezone.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/default-behavior.java b/examples/java/advanced/serialization/default-behavior.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/default-behavior.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/encryption.java b/examples/java/advanced/serialization/encryption.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/encryption.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/extended-types.java b/examples/java/advanced/serialization/extended-types.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/extended-types.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/faq-binary-data.java b/examples/java/advanced/serialization/faq-binary-data.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/faq-binary-data.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/faq-debug-issues.java b/examples/java/advanced/serialization/faq-debug-issues.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/faq-debug-issues.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/faq-json-strings.java b/examples/java/advanced/serialization/faq-json-strings.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/faq-json-strings.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/faq-pydantic-models.java b/examples/java/advanced/serialization/faq-pydantic-models.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/faq-pydantic-models.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/faq-serialization-fails.java b/examples/java/advanced/serialization/faq-serialization-fails.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/faq-serialization-fails.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/handle-errors-gracefully.java b/examples/java/advanced/serialization/handle-errors-gracefully.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/handle-errors-gracefully.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/keep-data-small.java b/examples/java/advanced/serialization/keep-data-small.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/keep-data-small.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/large-payload-errors.java b/examples/java/advanced/serialization/large-payload-errors.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/large-payload-errors.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/map-parallel-config.java b/examples/java/advanced/serialization/map-parallel-config.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/map-parallel-config.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/primitive-types.java b/examples/java/advanced/serialization/primitive-types.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/primitive-types.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/pydantic-models.java b/examples/java/advanced/serialization/pydantic-models.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/pydantic-models.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/serialization-failed-error.java b/examples/java/advanced/serialization/serialization-failed-error.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/serialization-failed-error.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/step-config.java b/examples/java/advanced/serialization/step-config.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/step-config.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/test-round-trips.java b/examples/java/advanced/serialization/test-round-trips.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/test-round-trips.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/type-not-preserved.java b/examples/java/advanced/serialization/type-not-preserved.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/type-not-preserved.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/unsupported-type-error.java b/examples/java/advanced/serialization/unsupported-type-error.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/unsupported-type-error.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/use-custom-serdes.java b/examples/java/advanced/serialization/use-custom-serdes.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/use-custom-serdes.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/serialization/use-default-serialization.java b/examples/java/advanced/serialization/use-default-serialization.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/serialization/use-default-serialization.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/testing-modes/appropriate-timeouts.java b/examples/java/advanced/testing-modes/appropriate-timeouts.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/testing-modes/appropriate-timeouts.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/testing-modes/basic-cloud-test.java b/examples/java/advanced/testing-modes/basic-cloud-test.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/testing-modes/basic-cloud-test.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/testing-modes/custom-timeout.java b/examples/java/advanced/testing-modes/custom-timeout.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/testing-modes/custom-timeout.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/testing-modes/durable-execution-decorator.java b/examples/java/advanced/testing-modes/durable-execution-decorator.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/testing-modes/durable-execution-decorator.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/testing-modes/mode-agnostic-tests.java b/examples/java/advanced/testing-modes/mode-agnostic-tests.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/testing-modes/mode-agnostic-tests.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/testing-modes/mode-specific-assertions.java b/examples/java/advanced/testing-modes/mode-specific-assertions.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/testing-modes/mode-specific-assertions.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/testing-modes/test-markers.java b/examples/java/advanced/testing-modes/test-markers.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/testing-modes/test-markers.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/advanced/testing-modes/timeout-error.java b/examples/java/advanced/testing-modes/timeout-error.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/advanced/testing-modes/timeout-error.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/basic-callback-testing.java b/examples/java/core/callbacks/basic-callback-testing.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/basic-callback-testing.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/basic-example.java b/examples/java/core/callbacks/basic-example.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/basic-example.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/callback-config.java b/examples/java/core/callbacks/callback-config.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/callback-config.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/callback-with-fallback.java b/examples/java/core/callbacks/callback-with-fallback.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/callback-with-fallback.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/conditional-callback-handling.java b/examples/java/core/callbacks/conditional-callback-handling.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/conditional-callback-handling.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/create-callback-signature.java b/examples/java/core/callbacks/create-callback-signature.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/create-callback-signature.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/duration-helpers.java b/examples/java/core/callbacks/duration-helpers.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/duration-helpers.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/get-callback-id.java b/examples/java/core/callbacks/get-callback-id.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/get-callback-id.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/get-callback-result.java b/examples/java/core/callbacks/get-callback-result.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/get-callback-result.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/human-approval-workflow.java b/examples/java/core/callbacks/human-approval-workflow.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/human-approval-workflow.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/inspect-callback-operations.java b/examples/java/core/callbacks/inspect-callback-operations.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/inspect-callback-operations.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/message-broker-durable-function.java b/examples/java/core/callbacks/message-broker-durable-function.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/message-broker-durable-function.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/message-broker-notification-handler.java b/examples/java/core/callbacks/message-broker-notification-handler.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/message-broker-notification-handler.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/multiple-callbacks.java b/examples/java/core/callbacks/multiple-callbacks.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/multiple-callbacks.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/notify-failure.java b/examples/java/core/callbacks/notify-failure.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/notify-failure.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/notify-success.java b/examples/java/core/callbacks/notify-success.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/notify-success.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/payment-processing.java b/examples/java/core/callbacks/payment-processing.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/payment-processing.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/send-heartbeat.java b/examples/java/core/callbacks/send-heartbeat.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/send-heartbeat.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/test-callback-timeout.java b/examples/java/core/callbacks/test-callback-timeout.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/test-callback-timeout.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/test-integration-workflow.java b/examples/java/core/callbacks/test-integration-workflow.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/test-integration-workflow.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/third-party-api-integration.java b/examples/java/core/callbacks/third-party-api-integration.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/third-party-api-integration.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/wait-for-external-system.java b/examples/java/core/callbacks/wait-for-external-system.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/wait-for-external-system.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/wait-using-result.java b/examples/java/core/callbacks/wait-using-result.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/wait-using-result.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/callbacks/wait-using-wait-for-callback.java b/examples/java/core/callbacks/wait-using-wait-for-callback.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/callbacks/wait-using-wait-for-callback.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/handle-invocation-error.java b/examples/java/core/invoke/handle-invocation-error.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/handle-invocation-error.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/handle-timeout-error.java b/examples/java/core/invoke/handle-timeout-error.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/handle-timeout-error.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/invoke-method-signature.java b/examples/java/core/invoke/invoke-method-signature.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/invoke-method-signature.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/invoke-ondemand-function.java b/examples/java/core/invoke/invoke-ondemand-function.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/invoke-ondemand-function.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/invoke-service.java b/examples/java/core/invoke/invoke-service.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/invoke-service.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/invoke-with-config.java b/examples/java/core/invoke/invoke-with-config.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/invoke-with-config.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/orchestrate-workflow.java b/examples/java/core/invoke/orchestrate-workflow.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/orchestrate-workflow.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/parent-workflow.java b/examples/java/core/invoke/parent-workflow.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/parent-workflow.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/pass-context-between-invocations.java b/examples/java/core/invoke/pass-context-between-invocations.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/pass-context-between-invocations.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/pass-result-between-invokes.java b/examples/java/core/invoke/pass-result-between-invokes.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/pass-result-between-invokes.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/process-document.java b/examples/java/core/invoke/process-document.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/process-document.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/process-order.java b/examples/java/core/invoke/process-order.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/process-order.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/retry-example-10.java b/examples/java/core/invoke/retry-example-10.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/retry-example-10.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/serialize.java b/examples/java/core/invoke/serialize.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/serialize.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/set-timeout.java b/examples/java/core/invoke/set-timeout.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/set-timeout.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/test-basic-invoke.java b/examples/java/core/invoke/test-basic-invoke.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/test-basic-invoke.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/test-error-handling.java b/examples/java/core/invoke/test-error-handling.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/test-error-handling.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/test-inspect-invoke.java b/examples/java/core/invoke/test-inspect-invoke.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/test-inspect-invoke.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/test-mock-invoked-functions.java b/examples/java/core/invoke/test-mock-invoked-functions.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/test-mock-invoked-functions.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/invoke/test-timeout-handling.java b/examples/java/core/invoke/test-timeout-handling.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/invoke/test-timeout-handling.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/add-custom-metadata.java b/examples/java/core/logger/add-custom-metadata.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/add-custom-metadata.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/automatic-context-enrichment.java b/examples/java/core/logger/automatic-context-enrichment.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/automatic-context-enrichment.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/avoid-sensitive-data.java b/examples/java/core/logger/avoid-sensitive-data.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/avoid-sensitive-data.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/basic-usage.java b/examples/java/core/logger/basic-usage.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/basic-usage.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/child-workflow.java b/examples/java/core/logger/child-workflow.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/child-workflow.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/context-logger-deduplication.java b/examples/java/core/logger/context-logger-deduplication.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/context-logger-deduplication.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/direct-logger-duplicates.java b/examples/java/core/logger/direct-logger-duplicates.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/direct-logger-duplicates.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/include-business-context.java b/examples/java/core/logger/include-business-context.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/include-business-context.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/integrate-powertools-context.java b/examples/java/core/logger/integrate-powertools-context.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/integrate-powertools-context.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/lambda-log-controls.java b/examples/java/core/logger/lambda-log-controls.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/lambda-log-controls.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/logger-interface-protocol.java b/examples/java/core/logger/logger-interface-protocol.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/logger-interface-protocol.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/logger-method-signature.java b/examples/java/core/logger/logger-method-signature.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/logger-method-signature.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/powertools-with-deduplication.java b/examples/java/core/logger/powertools-with-deduplication.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/powertools-with-deduplication.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/selective-logging.java b/examples/java/core/logger/selective-logging.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/selective-logging.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/set-powertools-log-level.java b/examples/java/core/logger/set-powertools-log-level.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/set-powertools-log-level.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/set-standard-log-level.java b/examples/java/core/logger/set-standard-log-level.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/set-standard-log-level.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/silence-botocore.java b/examples/java/core/logger/silence-botocore.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/silence-botocore.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/structured-logging-extra.java b/examples/java/core/logger/structured-logging-extra.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/structured-logging-extra.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/test-basic-logger.java b/examples/java/core/logger/test-basic-logger.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/test-basic-logger.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/test-verify-log-output.java b/examples/java/core/logger/test-verify-log-output.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/test-verify-log-output.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/test-with-powertools.java b/examples/java/core/logger/test-with-powertools.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/test-with-powertools.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/use-powertools-directly.java b/examples/java/core/logger/use-powertools-directly.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/use-powertools-directly.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/logger/use-powertools-production.java b/examples/java/core/logger/use-powertools-production.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/logger/use-powertools-production.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/map/access-individual-results.java b/examples/java/core/map/access-individual-results.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/map/access-individual-results.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/map/check-inventory.java b/examples/java/core/map/check-inventory.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/map/check-inventory.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/map/custom-completion-criteria.java b/examples/java/core/map/custom-completion-criteria.java deleted file mode 100644 index fea5119..0000000 --- a/examples/java/core/map/custom-completion-criteria.java +++ /dev/null @@ -1,25 +0,0 @@ -List items = IntStream.range(0, 20) - .boxed() - .collect(Collectors.toList()); - -MapConfig config = MapConfig.builder() - .completionConfig(CompletionConfig.builder() - .minSuccessful(15) // Succeed if at least 15 items succeed - .toleratedFailureCount(5) // Fail after 5 failures - .build()) - .build(); - -MapResult results = context.map( - "process-items", - items, - (ctx, item, index) -> { - // Processing that might fail - if (item % 7 == 0) { - throw new RuntimeException("Item " + item + " failed"); - } - return new ProcessedItem(item, true); - }, - config -); - -return results.getResults(); diff --git a/examples/java/core/map/fetch-data.java b/examples/java/core/map/fetch-data.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/map/fetch-data.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/map/fetch-user-data.java b/examples/java/core/map/fetch-user-data.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/map/fetch-user-data.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/map/map-function-signature.java b/examples/java/core/map/map-function-signature.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/map/map-function-signature.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/map/map-method-signature.java b/examples/java/core/map/map-method-signature.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/map/map-method-signature.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/map/process-item.java b/examples/java/core/map/process-item.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/map/process-item.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/map/square.java b/examples/java/core/map/square.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/map/square.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/map/test-basic-map.java b/examples/java/core/map/test-basic-map.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/map/test-basic-map.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/map/test-error-handling.java b/examples/java/core/map/test-error-handling.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/map/test-error-handling.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/map/test-handle-partial-failures.java b/examples/java/core/map/test-handle-partial-failures.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/map/test-handle-partial-failures.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/map/test-inspect-items.java b/examples/java/core/map/test-inspect-items.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/map/test-inspect-items.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/map/test-with-config.java b/examples/java/core/map/test-with-config.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/map/test-with-config.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/map/validate-email.java b/examples/java/core/map/validate-email.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/map/validate-email.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/access-individual-results.java b/examples/java/core/parallel/access-individual-results.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/access-individual-results.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/all-completed-strategy.java b/examples/java/core/parallel/all-completed-strategy.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/all-completed-strategy.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/all-successful-strategy.java b/examples/java/core/parallel/all-successful-strategy.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/all-successful-strategy.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/basic-usage.java b/examples/java/core/parallel/basic-usage.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/basic-usage.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/check-failures.java b/examples/java/core/parallel/check-failures.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/check-failures.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/collect-results.java b/examples/java/core/parallel/collect-results.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/collect-results.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/completion-config.java b/examples/java/core/parallel/completion-config.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/completion-config.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/concurrency-limits.java b/examples/java/core/parallel/concurrency-limits.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/concurrency-limits.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/controlled-concurrency.java b/examples/java/core/parallel/controlled-concurrency.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/controlled-concurrency.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/first-successful-pattern.java b/examples/java/core/parallel/first-successful-pattern.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/first-successful-pattern.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/first-successful-strategy.java b/examples/java/core/parallel/first-successful-strategy.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/first-successful-strategy.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/handle-partial-results.java b/examples/java/core/parallel/handle-partial-results.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/handle-partial-results.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/individual-branch-failures.java b/examples/java/core/parallel/individual-branch-failures.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/individual-branch-failures.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/max-concurrency.java b/examples/java/core/parallel/max-concurrency.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/max-concurrency.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/nested-parallel.java b/examples/java/core/parallel/nested-parallel.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/nested-parallel.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/parallel-config.java b/examples/java/core/parallel/parallel-config.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/parallel-config.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/parallel-method-signature.java b/examples/java/core/parallel/parallel-method-signature.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/parallel-method-signature.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/partial-success-handling.java b/examples/java/core/parallel/partial-success-handling.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/partial-success-handling.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/pass-different-arguments.java b/examples/java/core/parallel/pass-different-arguments.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/pass-different-arguments.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/result-ordering.java b/examples/java/core/parallel/result-ordering.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/result-ordering.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/simple-parallel.java b/examples/java/core/parallel/simple-parallel.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/simple-parallel.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/test-basic-parallel.java b/examples/java/core/parallel/test-basic-parallel.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/test-basic-parallel.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/test-completion-strategies.java b/examples/java/core/parallel/test-completion-strategies.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/test-completion-strategies.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/test-concurrency-limits.java b/examples/java/core/parallel/test-concurrency-limits.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/test-concurrency-limits.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/test-error-handling.java b/examples/java/core/parallel/test-error-handling.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/test-error-handling.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/parallel/test-inspect-branches.java b/examples/java/core/parallel/test-inspect-branches.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/parallel/test-inspect-branches.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/steps/basic-step-testing.java b/examples/java/core/steps/basic-step-testing.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/steps/basic-step-testing.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/steps/inspect-step-results.java b/examples/java/core/steps/inspect-step-results.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/steps/inspect-step-results.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/steps/lambda-step-example.java b/examples/java/core/steps/lambda-step-example.java deleted file mode 100644 index 9824127..0000000 --- a/examples/java/core/steps/lambda-step-example.java +++ /dev/null @@ -1,13 +0,0 @@ -import software.amazon.lambda.durable.DurableContext; -import software.amazon.lambda.durable.DurableHandler; -import software.amazon.lambda.durable.StepContext; - -public class LambdaStepExample extends DurableHandler { - @Override - public String handleRequest(Object input, DurableContext context) { - // Java always requires a name — use a descriptive string - String result = context.step("my_step", String.class, - (StepContext ctx) -> "some value"); - return result; - } -} diff --git a/examples/java/core/steps/test-error-handling.java b/examples/java/core/steps/test-error-handling.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/steps/test-error-handling.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/steps/test-retry-behavior.java b/examples/java/core/steps/test-retry-behavior.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/core/steps/test-retry-behavior.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/core/wait/appropriate-durations.java b/examples/java/core/wait/appropriate-durations.java deleted file mode 100644 index 19c5497..0000000 --- a/examples/java/core/wait/appropriate-durations.java +++ /dev/null @@ -1,8 +0,0 @@ -// Short wait for rate limiting -context.wait(null, Duration.ofSeconds(30)); - -// Medium wait for polling intervals -context.wait(null, Duration.ofMinutes(5)); - -// Long wait for scheduled tasks -context.wait(null, Duration.ofHours(24)); diff --git a/examples/java/core/wait/duration-from-seconds.java b/examples/java/core/wait/duration-from-seconds.java deleted file mode 100644 index 2dbe55a..0000000 --- a/examples/java/core/wait/duration-from-seconds.java +++ /dev/null @@ -1,2 +0,0 @@ -// Wait for 300 seconds (5 minutes) -context.wait(null, Duration.ofSeconds(300)); diff --git a/examples/java/core/wait/minimum-wait-duration.java b/examples/java/core/wait/minimum-wait-duration.java deleted file mode 100644 index 527a27a..0000000 --- a/examples/java/core/wait/minimum-wait-duration.java +++ /dev/null @@ -1,8 +0,0 @@ -// Avoid - too short, will throw an exception -context.wait(null, Duration.ofSeconds(0)); - -// Minimum - 1 second -context.wait(null, Duration.ofSeconds(1)); - -// Better - use meaningful durations -context.wait(null, Duration.ofSeconds(5)); diff --git a/examples/java/core/wait/multiple-named-waits.java b/examples/java/core/wait/multiple-named-waits.java deleted file mode 100644 index b4b5762..0000000 --- a/examples/java/core/wait/multiple-named-waits.java +++ /dev/null @@ -1,7 +0,0 @@ -// Good - clear purpose -context.wait("rate_limit_cooldown", Duration.ofSeconds(60)); -context.wait("polling_interval", Duration.ofMinutes(5)); - -// Less clear - unnamed waits -context.wait(null, Duration.ofSeconds(60)); -context.wait(null, Duration.ofMinutes(5)); diff --git a/examples/java/core/wait/polling-with-condition.java b/examples/java/core/wait/polling-with-condition.java deleted file mode 100644 index e9cf6fa..0000000 --- a/examples/java/core/wait/polling-with-condition.java +++ /dev/null @@ -1,35 +0,0 @@ -import java.time.Duration; -import java.util.Map; -import software.amazon.lambda.durable.DurableContext; -import software.amazon.lambda.durable.DurableHandler; -import software.amazon.lambda.durable.TypeToken; -import software.amazon.lambda.durable.config.WaitForConditionConfig; -import software.amazon.lambda.durable.model.WaitForConditionResult; -import software.amazon.lambda.durable.retry.WaitForConditionWaitStrategy; - -public class PollingWithConditionExample extends DurableHandler> { - - @Override - public Map handleRequest(Object input, DurableContext context) { - WaitForConditionWaitStrategy> strategy = - (state, attempt) -> Duration.ofMinutes(1); - - var config = WaitForConditionConfig.>builder() - .initialState(Map.of("jobId", "job-123", "status", "pending")) - .waitStrategy(strategy) - .build(); - - return context.waitForCondition( - "poll_job", - new TypeToken<>() {}, - (state, stepCtx) -> { - var status = getJobStatus(state.get("jobId")); - var updatedState = Map.of("jobId", state.get("jobId"), "status", status); - if ("completed".equals(status)) { - return WaitForConditionResult.stopPolling(updatedState); - } - return WaitForConditionResult.continuePolling(updatedState); - }, - config); - } -} diff --git a/examples/java/core/wait/wait-between-steps.java b/examples/java/core/wait/wait-between-steps.java deleted file mode 100644 index 61894f1..0000000 --- a/examples/java/core/wait/wait-between-steps.java +++ /dev/null @@ -1,15 +0,0 @@ -public class WaitBetweenStepsExample extends DurableHandler> { - @Override - public Map handleRequest(Object input, DurableContext context) { - // Start a process - var jobId = context.step("start_job", String.class, stepCtx -> startJob()); - - // Wait before checking status - context.wait("initial_delay", Duration.ofSeconds(30)); - - // Check status - var status = context.step("check_status", String.class, stepCtx -> checkJobStatus(jobId)); - - return Map.of("jobId", jobId, "status", status); - } -} diff --git a/examples/java/core/wait/wait-for-external-response.java b/examples/java/core/wait/wait-for-external-response.java deleted file mode 100644 index 91c3aaf..0000000 --- a/examples/java/core/wait/wait-for-external-response.java +++ /dev/null @@ -1,16 +0,0 @@ -import software.amazon.lambda.durable.DurableContext; -import software.amazon.lambda.durable.DurableHandler; - -public class WaitForExternalResponseExample extends DurableHandler { - @Override - public String handleRequest(Object input, DurableContext context) { - // Wait for external approval - var result = context.waitForCallback( - "approval_wait", String.class, - (callbackId, stepCtx) -> { - // Send callback_id to external approval system - sendToApprovalSystem(callbackId); - }); - return result; - } -} diff --git a/examples/java/getting-started/custom-boto3-client.java b/examples/java/getting-started/custom-boto3-client.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/getting-started/custom-boto3-client.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/getting-started/test-locally.java b/examples/java/getting-started/test-locally.java deleted file mode 100644 index 740a436..0000000 --- a/examples/java/getting-started/test-locally.java +++ /dev/null @@ -1,24 +0,0 @@ -import java.util.Map; -import org.junit.jupiter.api.Test; -import software.amazon.lambda.durable.DurableContext; -import software.amazon.lambda.durable.model.ExecutionStatus; -import software.amazon.lambda.durable.testing.LocalDurableTestRunner; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class TestLocally { - - @Test - void testMyFunction() { - var runner = LocalDurableTestRunner.create( - Map.class, - (Map input, DurableContext context) -> - context.step("my-step", String.class, - stepCtx -> "processed-" + input.get("data"))); - - var result = runner.runUntilComplete(Map.of("data", "test")); - - assertEquals(ExecutionStatus.SUCCEEDED, result.getStatus()); - assertEquals("processed-test", result.getResult()); - } -} diff --git a/examples/java/index/quick-example.java b/examples/java/index/quick-example.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/index/quick-example.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/operations/child-contexts/basic-child-context-testing.java b/examples/java/operations/child-contexts/basic-child-context-testing.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/operations/child-contexts/basic-child-context-testing.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/operations/child-contexts/data-processing.java b/examples/java/operations/child-contexts/data-processing.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/operations/child-contexts/data-processing.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/operations/child-contexts/decorator-example.java b/examples/java/operations/child-contexts/decorator-example.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/operations/child-contexts/decorator-example.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/operations/child-contexts/inspect-child-context-operations.java b/examples/java/operations/child-contexts/inspect-child-context-operations.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/operations/child-contexts/inspect-child-context-operations.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/operations/child-contexts/inventory-check.java b/examples/java/operations/child-contexts/inventory-check.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/operations/child-contexts/inventory-check.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/operations/child-contexts/process-order.java b/examples/java/operations/child-contexts/process-order.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/operations/child-contexts/process-order.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/operations/child-contexts/process-region-a.java b/examples/java/operations/child-contexts/process-region-a.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/operations/child-contexts/process-region-a.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/operations/child-contexts/risky-operation.java b/examples/java/operations/child-contexts/risky-operation.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/operations/child-contexts/risky-operation.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/operations/child-contexts/send-notifications.java b/examples/java/operations/child-contexts/send-notifications.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/operations/child-contexts/send-notifications.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/operations/child-contexts/standard-processing.java b/examples/java/operations/child-contexts/standard-processing.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/operations/child-contexts/standard-processing.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/operations/child-contexts/test-error-handling.java b/examples/java/operations/child-contexts/test-error-handling.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/operations/child-contexts/test-error-handling.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/operations/child-contexts/test-large-data-handling.java b/examples/java/operations/child-contexts/test-large-data-handling.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/operations/child-contexts/test-large-data-handling.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/operations/child-contexts/validate-order.java b/examples/java/operations/child-contexts/validate-order.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/operations/child-contexts/validate-order.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/operations/parallel/parallel-signature.java b/examples/java/operations/parallel/parallel-signature.java deleted file mode 100644 index 468d7f3..0000000 --- a/examples/java/operations/parallel/parallel-signature.java +++ /dev/null @@ -1,11 +0,0 @@ -// Create a parallel operation (returns ParallelDurableFuture) -ParallelDurableFuture parallel(String name) -ParallelDurableFuture parallel(String name, ParallelConfig config) - -// Register a branch on the ParallelDurableFuture - DurableFuture branch(String name, Class resultType, Function func) - DurableFuture branch(String name, TypeToken resultType, Function func) - DurableFuture branch(String name, Class resultType, Function func, ParallelBranchConfig config) - -// Block until all branches complete (also called by close()) -ParallelResult get() diff --git a/examples/java/operations/steps/process-payment.java b/examples/java/operations/steps/process-payment.java deleted file mode 100644 index 8cce8ee..0000000 --- a/examples/java/operations/steps/process-payment.java +++ /dev/null @@ -1,16 +0,0 @@ -import java.util.Map; -import software.amazon.lambda.durable.DurableContext; -import software.amazon.lambda.durable.DurableHandler; -import software.amazon.lambda.durable.StepContext; - -public class ProcessPaymentExample extends DurableHandler, Map> { - @Override - public Map handleRequest(Map event, DurableContext context) { - double amount = (double) event.get("amount"); - - Map result = context.step("process_payment", Map.class, - (StepContext ctx) -> Map.of("status", "completed", "amount", amount)); - - return result; - } -} diff --git a/examples/java/sdk-reference/error-handling/base-exception.java b/examples/java/sdk-reference/error-handling/base-exception.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/base-exception.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/callback-error.java b/examples/java/sdk-reference/error-handling/callback-error.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/callback-error.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/callback-timeout.java b/examples/java/sdk-reference/error-handling/callback-timeout.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/callback-timeout.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/checkpoint-failed.java b/examples/java/sdk-reference/error-handling/checkpoint-failed.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/checkpoint-failed.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/execution-error.java b/examples/java/sdk-reference/error-handling/execution-error.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/execution-error.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/faq-error-details.java b/examples/java/sdk-reference/error-handling/faq-error-details.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/faq-error-details.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/faq-parallel-errors.java b/examples/java/sdk-reference/error-handling/faq-parallel-errors.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/faq-parallel-errors.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/faq-prevent-duplicates.java b/examples/java/sdk-reference/error-handling/faq-prevent-duplicates.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/faq-prevent-duplicates.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/faq-retry-specific.java b/examples/java/sdk-reference/error-handling/faq-retry-specific.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/faq-retry-specific.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/input-validation.java b/examples/java/sdk-reference/error-handling/input-validation.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/input-validation.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/invocation-error.java b/examples/java/sdk-reference/error-handling/invocation-error.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/invocation-error.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/multiple-error-types.java b/examples/java/sdk-reference/error-handling/multiple-error-types.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/multiple-error-types.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/permanent-failures.java b/examples/java/sdk-reference/error-handling/permanent-failures.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/permanent-failures.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/retries-exhausted.java b/examples/java/sdk-reference/error-handling/retries-exhausted.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/retries-exhausted.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/retry-specific-exceptions.java b/examples/java/sdk-reference/error-handling/retry-specific-exceptions.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/retry-specific-exceptions.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/retry-strategy-config.java b/examples/java/sdk-reference/error-handling/retry-strategy-config.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/retry-strategy-config.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/step-interrupted-error.java b/examples/java/sdk-reference/error-handling/step-interrupted-error.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/step-interrupted-error.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/test-error-conditions.java b/examples/java/sdk-reference/error-handling/test-error-conditions.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/test-error-conditions.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/test-inspect-error-details.java b/examples/java/sdk-reference/error-handling/test-inspect-error-details.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/test-inspect-error-details.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/test-retry-behavior.java b/examples/java/sdk-reference/error-handling/test-retry-behavior.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/test-retry-behavior.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/test-retry-exhaustion.java b/examples/java/sdk-reference/error-handling/test-retry-exhaustion.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/test-retry-exhaustion.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/test-sdk-validation.java b/examples/java/sdk-reference/error-handling/test-sdk-validation.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/test-sdk-validation.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/test-successful-execution.java b/examples/java/sdk-reference/error-handling/test-successful-execution.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/test-successful-execution.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/transient-failures.java b/examples/java/sdk-reference/error-handling/transient-failures.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/transient-failures.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/unrecoverable-error.java b/examples/java/sdk-reference/error-handling/unrecoverable-error.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/sdk-reference/error-handling/unrecoverable-error.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/sdk-reference/error-handling/unreliable-operation.java b/examples/java/sdk-reference/error-handling/unreliable-operation.java deleted file mode 100644 index 06ceb14..0000000 --- a/examples/java/sdk-reference/error-handling/unreliable-operation.java +++ /dev/null @@ -1,30 +0,0 @@ -import java.time.Duration; -import software.amazon.lambda.durable.DurableContext; -import software.amazon.lambda.durable.DurableHandler; -import software.amazon.lambda.durable.StepContext; -import software.amazon.lambda.durable.config.StepConfig; -import software.amazon.lambda.durable.retry.JitterStrategy; -import software.amazon.lambda.durable.retry.RetryStrategies; - -public class UnreliableOperationExample extends DurableHandler { - @Override - public String handleRequest(Object input, DurableContext context) { - StepConfig config = StepConfig.builder() - .retryStrategy(RetryStrategies.exponentialBackoff( - 3, - Duration.ofSeconds(1), - Duration.ofMinutes(5), - 2.0, - JitterStrategy.FULL)) - .build(); - - String result = context.step("unreliable_operation", String.class, - (StepContext ctx) -> { - if (Math.random() > 0.5) throw new RuntimeException("Random error occurred"); - return "Operation succeeded"; - }, - config); - - return result; - } -} diff --git a/examples/java/sdk-reference/observability/custom-logger.java b/examples/java/sdk-reference/observability/custom-logger.java deleted file mode 100644 index 45d30f1..0000000 --- a/examples/java/sdk-reference/observability/custom-logger.java +++ /dev/null @@ -1,21 +0,0 @@ -import software.amazon.lambda.durable.DurableConfig; -import software.amazon.lambda.durable.DurableContext; -import software.amazon.lambda.durable.DurableHandler; -import software.amazon.lambda.durable.logging.LoggerConfig; - -public class CustomLogger extends DurableHandler { - - @Override - protected DurableConfig createConfiguration() { - // Allow logs during replay by overriding the default LoggerConfig. - return DurableConfig.builder() - .withLoggerConfig(LoggerConfig.withReplayLogging()) - .build(); - } - - @Override - public Void handleRequest(Object event, DurableContext context) { - context.getLogger().info("Logs appear on every replay"); - return null; - } -} diff --git a/examples/java/sdk-reference/observability/logger-interface.java b/examples/java/sdk-reference/observability/logger-interface.java deleted file mode 100644 index a9b4e89..0000000 --- a/examples/java/sdk-reference/observability/logger-interface.java +++ /dev/null @@ -1,17 +0,0 @@ -import org.slf4j.Logger; -import software.amazon.lambda.durable.logging.DurableLogger; - -// DurableLogger wraps an SLF4J Logger and adds MDC entries: -// durableExecutionArn, requestId, operationId, operationName, attempt -// -// Obtain it from any context: -// DurableLogger logger = context.getLogger(); -// DurableLogger logger = stepContext.getLogger(); -// -// Available methods: -// logger.trace(String format, Object... args) -// logger.debug(String format, Object... args) -// logger.info(String format, Object... args) -// logger.warn(String format, Object... args) -// logger.error(String format, Object... args) -// logger.error(String message, Throwable t) diff --git a/examples/java/testing-patterns/basic-tests/add-docstrings.java b/examples/java/testing-patterns/basic-tests/add-docstrings.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/add-docstrings.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/basic-step-testing.java b/examples/java/testing-patterns/basic-tests/basic-step-testing.java deleted file mode 100644 index c39edac..0000000 --- a/examples/java/testing-patterns/basic-tests/basic-step-testing.java +++ /dev/null @@ -1,17 +0,0 @@ -import static org.junit.jupiter.api.Assertions.*; - -import org.junit.jupiter.api.Test; -import software.amazon.lambda.durable.model.ExecutionStatus; -import software.amazon.lambda.durable.testing.LocalDurableTestRunner; - -class BasicStepTestingTest { - @Test - void testStep() { - var runner = LocalDurableTestRunner.create(Object.class, new AddNumbersExample()); - - var result = runner.runUntilComplete(null); - - assertEquals(ExecutionStatus.SUCCEEDED, result.getStatus()); - assertEquals(8, result.getResult(Integer.class)); - } -} diff --git a/examples/java/testing-patterns/basic-tests/callback-function.java b/examples/java/testing-patterns/basic-tests/callback-function.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/callback-function.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/check-expected-failures.java b/examples/java/testing-patterns/basic-tests/check-expected-failures.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/check-expected-failures.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/check-success.java b/examples/java/testing-patterns/basic-tests/check-success.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/check-success.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/check-timeout.java b/examples/java/testing-patterns/basic-tests/check-timeout.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/check-timeout.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/child-context-function.java b/examples/java/testing-patterns/basic-tests/child-context-function.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/child-context-function.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/conftest-setup.java b/examples/java/testing-patterns/basic-tests/conftest-setup.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/conftest-setup.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/descriptive-test-names.java b/examples/java/testing-patterns/basic-tests/descriptive-test-names.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/descriptive-test-names.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/group-related-tests.java b/examples/java/testing-patterns/basic-tests/group-related-tests.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/group-related-tests.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/inspect-step-results.java b/examples/java/testing-patterns/basic-tests/inspect-step-results.java deleted file mode 100644 index a486f5b..0000000 --- a/examples/java/testing-patterns/basic-tests/inspect-step-results.java +++ /dev/null @@ -1,17 +0,0 @@ -import static org.junit.jupiter.api.Assertions.*; - -import org.junit.jupiter.api.Test; -import software.amazon.lambda.durable.model.ExecutionStatus; -import software.amazon.lambda.durable.testing.LocalDurableTestRunner; - -class InspectStepResultsErrorTest { - @Test - void testStepFailsWithError() { - var runner = LocalDurableTestRunner.create(Object.class, new FailingStepExample()); - - var result = runner.runUntilComplete(null); - - assertEquals(ExecutionStatus.FAILED, result.getStatus()); - assertTrue(result.getError().isPresent()); - } -} diff --git a/examples/java/testing-patterns/basic-tests/keep-tests-focused.java b/examples/java/testing-patterns/basic-tests/keep-tests-focused.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/keep-tests-focused.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/parallel-function.java b/examples/java/testing-patterns/basic-tests/parallel-function.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/parallel-function.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/parametrized-tests.java b/examples/java/testing-patterns/basic-tests/parametrized-tests.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/parametrized-tests.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/simple-function.java b/examples/java/testing-patterns/basic-tests/simple-function.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/simple-function.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/simple-test.java b/examples/java/testing-patterns/basic-tests/simple-test.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/simple-test.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/step-function.java b/examples/java/testing-patterns/basic-tests/step-function.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/step-function.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/test-error-handling.java b/examples/java/testing-patterns/basic-tests/test-error-handling.java deleted file mode 100644 index f08b04c..0000000 --- a/examples/java/testing-patterns/basic-tests/test-error-handling.java +++ /dev/null @@ -1,22 +0,0 @@ -import static org.junit.jupiter.api.Assertions.*; - -import org.junit.jupiter.api.Test; -import software.amazon.awssdk.services.lambda.model.OperationStatus; -import software.amazon.lambda.durable.model.ExecutionStatus; -import software.amazon.lambda.durable.testing.LocalDurableTestRunner; - -class InspectStepResultsTest { - @Test - void testInspectStepResult() { - var runner = LocalDurableTestRunner.create(Object.class, new AddNumbersExample()); - - var result = runner.runUntilComplete(null); - - assertEquals(ExecutionStatus.SUCCEEDED, result.getStatus()); - - var stepOp = runner.getOperation("add_numbers"); - assertNotNull(stepOp); - assertEquals(OperationStatus.SUCCEEDED, stepOp.getStatus()); - assertEquals(8, stepOp.getStepResult(Integer.class)); - } -} diff --git a/examples/java/testing-patterns/basic-tests/test-retry-behavior.java b/examples/java/testing-patterns/basic-tests/test-retry-behavior.java deleted file mode 100644 index acae03f..0000000 --- a/examples/java/testing-patterns/basic-tests/test-retry-behavior.java +++ /dev/null @@ -1,21 +0,0 @@ -import static org.junit.jupiter.api.Assertions.*; - -import org.junit.jupiter.api.Test; -import software.amazon.awssdk.services.lambda.model.OperationStatus; -import software.amazon.lambda.durable.model.ExecutionStatus; -import software.amazon.lambda.durable.testing.LocalDurableTestRunner; - -class TestRetryBehaviorTest { - @Test - void testStepRetriesAndSucceeds() { - var runner = LocalDurableTestRunner.create(Object.class, new UnreliableOperationExample()); - - var result = runner.runUntilComplete(null); - - assertEquals(ExecutionStatus.SUCCEEDED, result.getStatus()); - - var stepOp = runner.getOperation("unreliable_operation"); - assertNotNull(stepOp); - assertEquals(OperationStatus.SUCCEEDED, stepOp.getStatus()); - } -} diff --git a/examples/java/testing-patterns/basic-tests/test-wait-operation.java b/examples/java/testing-patterns/basic-tests/test-wait-operation.java deleted file mode 100644 index ee042bb..0000000 --- a/examples/java/testing-patterns/basic-tests/test-wait-operation.java +++ /dev/null @@ -1,23 +0,0 @@ -import static org.junit.jupiter.api.Assertions.*; - -import org.junit.jupiter.api.Test; -import software.amazon.lambda.durable.model.ExecutionStatus; -import software.amazon.awssdk.services.lambda.model.OperationType; -import software.amazon.lambda.durable.testing.LocalDurableTestRunner; - -@Test -void testWait() { - var runner = LocalDurableTestRunner.create(Object.class, new BasicWaitExample()); - - var result = runner.runUntilComplete("test"); - - assertEquals(ExecutionStatus.SUCCEEDED, result.getStatus()); - assertEquals("Wait completed", result.getResult(String.class)); - - // Find the wait operation - var waitOps = result.getOperations().stream() - .filter(op -> op.getType() == OperationType.WAIT) - .toList(); - assertEquals(1, waitOps.size()); - assertNotNull(waitOps.get(0).getWaitDetails().scheduledEndTimestamp()); -} diff --git a/examples/java/testing-patterns/basic-tests/use-fixtures.java b/examples/java/testing-patterns/basic-tests/use-fixtures.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/use-fixtures.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/verify-callback-operations.java b/examples/java/testing-patterns/basic-tests/verify-callback-operations.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/verify-callback-operations.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/verify-child-context.java b/examples/java/testing-patterns/basic-tests/verify-child-context.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/verify-child-context.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/verify-complex-values.java b/examples/java/testing-patterns/basic-tests/verify-complex-values.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/verify-complex-values.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/verify-list-results.java b/examples/java/testing-patterns/basic-tests/verify-list-results.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/verify-list-results.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/verify-parallel-operations.java b/examples/java/testing-patterns/basic-tests/verify-parallel-operations.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/verify-parallel-operations.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/verify-simple-values.java b/examples/java/testing-patterns/basic-tests/verify-simple-values.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/verify-simple-values.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/verify-step-operations.java b/examples/java/testing-patterns/basic-tests/verify-step-operations.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/verify-step-operations.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/verify-wait-operations.java b/examples/java/testing-patterns/basic-tests/verify-wait-operations.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/verify-wait-operations.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/basic-tests/wait-function.java b/examples/java/testing-patterns/basic-tests/wait-function.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/basic-tests/wait-function.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/basic-parallel-workflow.java b/examples/java/testing-patterns/complex-workflows/basic-parallel-workflow.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/basic-parallel-workflow.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/callback-timeouts-workflow.java b/examples/java/testing-patterns/complex-workflows/callback-timeouts-workflow.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/callback-timeouts-workflow.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/conditional-branching-workflow.java b/examples/java/testing-patterns/complex-workflows/conditional-branching-workflow.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/conditional-branching-workflow.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/expected-failures-workflow.java b/examples/java/testing-patterns/complex-workflows/expected-failures-workflow.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/expected-failures-workflow.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/long-waits-workflow.java b/examples/java/testing-patterns/complex-workflows/long-waits-workflow.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/long-waits-workflow.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/maximum-attempts-workflow.java b/examples/java/testing-patterns/complex-workflows/maximum-attempts-workflow.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/maximum-attempts-workflow.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/multiple-child-contexts-workflow.java b/examples/java/testing-patterns/complex-workflows/multiple-child-contexts-workflow.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/multiple-child-contexts-workflow.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/partial-failures-workflow.java b/examples/java/testing-patterns/complex-workflows/partial-failures-workflow.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/partial-failures-workflow.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/processing-collections-workflow.java b/examples/java/testing-patterns/complex-workflows/processing-collections-workflow.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/processing-collections-workflow.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/retry-behavior-workflow.java b/examples/java/testing-patterns/complex-workflows/retry-behavior-workflow.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/retry-behavior-workflow.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/sequential-workflow.java b/examples/java/testing-patterns/complex-workflows/sequential-workflow.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/sequential-workflow.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/single-child-context-workflow.java b/examples/java/testing-patterns/complex-workflows/single-child-context-workflow.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/single-child-context-workflow.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/test-basic-parallel.java b/examples/java/testing-patterns/complex-workflows/test-basic-parallel.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/test-basic-parallel.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/test-callback-timeouts.java b/examples/java/testing-patterns/complex-workflows/test-callback-timeouts.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/test-callback-timeouts.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/test-conditional-branching.java b/examples/java/testing-patterns/complex-workflows/test-conditional-branching.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/test-conditional-branching.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/test-expected-failures.java b/examples/java/testing-patterns/complex-workflows/test-expected-failures.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/test-expected-failures.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/test-long-waits.java b/examples/java/testing-patterns/complex-workflows/test-long-waits.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/test-long-waits.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/test-maximum-attempts.java b/examples/java/testing-patterns/complex-workflows/test-maximum-attempts.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/test-maximum-attempts.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/test-multiple-child-contexts.java b/examples/java/testing-patterns/complex-workflows/test-multiple-child-contexts.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/test-multiple-child-contexts.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/test-partial-failures.java b/examples/java/testing-patterns/complex-workflows/test-partial-failures.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/test-partial-failures.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/test-processing-collections.java b/examples/java/testing-patterns/complex-workflows/test-processing-collections.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/test-processing-collections.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/test-retry-behavior.java b/examples/java/testing-patterns/complex-workflows/test-retry-behavior.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/test-retry-behavior.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/test-sequential-operations.java b/examples/java/testing-patterns/complex-workflows/test-sequential-operations.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/test-sequential-operations.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/test-single-child-context.java b/examples/java/testing-patterns/complex-workflows/test-single-child-context.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/test-single-child-context.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/test-wait-for-condition.java b/examples/java/testing-patterns/complex-workflows/test-wait-for-condition.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/test-wait-for-condition.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/complex-workflows/wait-for-condition-workflow.java b/examples/java/testing-patterns/complex-workflows/wait-for-condition-workflow.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/complex-workflows/wait-for-condition-workflow.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/stores/filesystem-store.java b/examples/java/testing-patterns/stores/filesystem-store.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/stores/filesystem-store.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/stores/in-memory-store.java b/examples/java/testing-patterns/stores/in-memory-store.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/stores/in-memory-store.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/java/testing-patterns/stores/programmatic-config.java b/examples/java/testing-patterns/stores/programmatic-config.java deleted file mode 100644 index 48cdd22..0000000 --- a/examples/java/testing-patterns/stores/programmatic-config.java +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/python/advanced/serialization/appropriate-types.py b/examples/python/advanced/serialization/appropriate-types.py deleted file mode 100644 index 3aaeaea..0000000 --- a/examples/python/advanced/serialization/appropriate-types.py +++ /dev/null @@ -1,5 +0,0 @@ -# Good - Decimal for precise amounts -amount = Decimal("99.99") - -# Avoid - float for money (precision issues) -amount = 99.99 diff --git a/examples/python/advanced/serialization/callback-config.py b/examples/python/advanced/serialization/callback-config.py deleted file mode 100644 index d06755d..0000000 --- a/examples/python/advanced/serialization/callback-config.py +++ /dev/null @@ -1,13 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution -from aws_durable_execution_sdk_python.config import CallbackConfig, Duration - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - config = CallbackConfig( - timeout=Duration.from_hours(2), - serdes=CustomSerDes() - ) - callback = context.create_callback(config=config) - - # Send callback.callback_id to external system - return {"callback_id": callback.callback_id} diff --git a/examples/python/advanced/serialization/container-types.py b/examples/python/advanced/serialization/container-types.py deleted file mode 100644 index 9ca4e95..0000000 --- a/examples/python/advanced/serialization/container-types.py +++ /dev/null @@ -1,29 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution -from datetime import datetime -from decimal import Decimal -from uuid import uuid4 - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - # Nested structures serialize automatically - complex_data = { - "user": { - "id": uuid4(), - "created": datetime.now(), - "balance": Decimal("1234.56"), - "metadata": b"binary_data", - "coordinates": (40.7128, -74.0060), - "tags": ["premium", "verified"], - "settings": { - "notifications": True, - "theme": "dark", - "limits": { - "daily": Decimal("500.00"), - "monthly": Decimal("10000.00"), - }, - }, - } - } - - result = context.step(process_user, complex_data) - return result diff --git a/examples/python/advanced/serialization/convert-to-dicts.py b/examples/python/advanced/serialization/convert-to-dicts.py deleted file mode 100644 index ae8c08d..0000000 --- a/examples/python/advanced/serialization/convert-to-dicts.py +++ /dev/null @@ -1,6 +0,0 @@ -# Good - convert to dict first -order_dict = order.to_dict() -result = context.step(process_order, order_dict) - -# Avoid - custom objects aren't serializable -result = context.step(process_order, order) # Will fail diff --git a/examples/python/advanced/serialization/custom-objects.py b/examples/python/advanced/serialization/custom-objects.py deleted file mode 100644 index 5f41f27..0000000 --- a/examples/python/advanced/serialization/custom-objects.py +++ /dev/null @@ -1,30 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution - -class Order: - def __init__(self, order_id: str, amount: float, customer: str): - self.order_id = order_id - self.amount = amount - self.customer = customer - - def to_dict(self) -> dict: - return { - "order_id": self.order_id, - "amount": self.amount, - "customer": self.customer - } - - @classmethod - def from_dict(cls, data: dict) -> "Order": - return cls( - order_id=data["order_id"], - amount=data["amount"], - customer=data["customer"] - ) - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - order = Order("ORD-123", 99.99, "Jane Doe") - - # Convert to dict before passing to step - result = context.step(process_order, order.to_dict()) - return result diff --git a/examples/python/advanced/serialization/custom-serdes.py b/examples/python/advanced/serialization/custom-serdes.py deleted file mode 100644 index dfabd30..0000000 --- a/examples/python/advanced/serialization/custom-serdes.py +++ /dev/null @@ -1,11 +0,0 @@ -from aws_durable_execution_sdk_python.serdes import SerDes, SerDesContext -import json - -class UpperCaseSerDes(SerDes[str]): - """Example: Convert strings to uppercase during serialization.""" - - def serialize(self, value: str, serdes_context: SerDesContext) -> str: - return value.upper() - - def deserialize(self, data: str, serdes_context: SerDesContext) -> str: - return data.lower() diff --git a/examples/python/advanced/serialization/dataclasses.py b/examples/python/advanced/serialization/dataclasses.py deleted file mode 100644 index 2391b48..0000000 --- a/examples/python/advanced/serialization/dataclasses.py +++ /dev/null @@ -1,20 +0,0 @@ -from dataclasses import dataclass, asdict -from aws_durable_execution_sdk_python import DurableContext, durable_execution - -@dataclass -class Order: - order_id: str - amount: float - customer: str - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - order = Order( - order_id="ORD-123", - amount=99.99, - customer="Jane Doe" - ) - - # Convert to dict before passing to step - result = context.step(process_order, asdict(order)) - return result diff --git a/examples/python/advanced/serialization/datetime-timezone.py b/examples/python/advanced/serialization/datetime-timezone.py deleted file mode 100644 index efcf1c8..0000000 --- a/examples/python/advanced/serialization/datetime-timezone.py +++ /dev/null @@ -1,7 +0,0 @@ -from datetime import datetime, UTC - -# Good - timezone aware -timestamp = datetime.now(UTC) - -# Avoid - naive datetime -timestamp = datetime.now() # No timezone diff --git a/examples/python/advanced/serialization/default-behavior.py b/examples/python/advanced/serialization/default-behavior.py deleted file mode 100644 index 5534b04..0000000 --- a/examples/python/advanced/serialization/default-behavior.py +++ /dev/null @@ -1,15 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution -from datetime import datetime -from decimal import Decimal -from uuid import uuid4 - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - # All these types serialize automatically - result = context.step( - process_order, - order_id=uuid4(), - amount=Decimal("99.99"), - timestamp=datetime.now() - ) - return result diff --git a/examples/python/advanced/serialization/encryption.py b/examples/python/advanced/serialization/encryption.py deleted file mode 100644 index d171b30..0000000 --- a/examples/python/advanced/serialization/encryption.py +++ /dev/null @@ -1,45 +0,0 @@ -import base64 -import json - -from aws_durable_execution_sdk_python import ( - DurableContext, - StepContext, - durable_execution, - durable_step, -) -from aws_durable_execution_sdk_python.config import StepConfig -from aws_durable_execution_sdk_python.serdes import SerDes, SerDesContext - - -class EncryptedSerDes(SerDes[dict]): - """Example: Encrypt sensitive data (simplified for demonstration).""" - - def __init__(self, encryption_key: str): - self.encryption_key = encryption_key - - def serialize(self, value: dict, serdes_context: SerDesContext) -> str: - json_str = json.dumps(value) - # In production, use proper encryption like AWS KMS - encrypted = base64.b64encode(json_str.encode()).decode() - return encrypted - - def deserialize(self, data: str, serdes_context: SerDesContext) -> dict: - # In production, use proper decryption - decrypted = base64.b64decode(data.encode()).decode() - return json.loads(decrypted) - - -@durable_step -def process_sensitive_data(step_context: StepContext, data: dict) -> dict: - return {"processed": True} - - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - sensitive_data = {"ssn": "123-45-6789", "credit_card": "4111-1111-1111-1111"} - - # Encrypt data in checkpoints - config = StepConfig(serdes=EncryptedSerDes("my-key")) - result = context.step(process_sensitive_data(sensitive_data), config=config) - - return result diff --git a/examples/python/advanced/serialization/extended-types.py b/examples/python/advanced/serialization/extended-types.py deleted file mode 100644 index 82c924a..0000000 --- a/examples/python/advanced/serialization/extended-types.py +++ /dev/null @@ -1,19 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution -from datetime import datetime, date -from decimal import Decimal -from uuid import UUID, uuid4 - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - # Extended types - automatic serialization - order_data = { - "order_id": uuid4(), # UUID - "amount": Decimal("99.99"), # Decimal - "created_at": datetime.now(), # datetime - "delivery_date": date.today(), # date - "signature": b"binary_signature_data", # bytes - "coordinates": (40.7128, -74.0060), # tuple - } - - result = context.step(process_order, order_data) - return result diff --git a/examples/python/advanced/serialization/faq-binary-data.py b/examples/python/advanced/serialization/faq-binary-data.py deleted file mode 100644 index 2d73061..0000000 --- a/examples/python/advanced/serialization/faq-binary-data.py +++ /dev/null @@ -1,2 +0,0 @@ -binary_data = b"binary content" -result = context.step(process_binary, binary_data) diff --git a/examples/python/advanced/serialization/faq-debug-issues.py b/examples/python/advanced/serialization/faq-debug-issues.py deleted file mode 100644 index 96cb641..0000000 --- a/examples/python/advanced/serialization/faq-debug-issues.py +++ /dev/null @@ -1,8 +0,0 @@ -from aws_durable_execution_sdk_python.serdes import serialize, deserialize - -try: - serialized = serialize(None, my_data, "test-op", "test-arn") - deserialized = deserialize(None, serialized, "test-op", "test-arn") - print("Serialization successful") -except Exception as e: - print(f"Serialization failed: {e}") diff --git a/examples/python/advanced/serialization/faq-json-strings.py b/examples/python/advanced/serialization/faq-json-strings.py deleted file mode 100644 index eae563f..0000000 --- a/examples/python/advanced/serialization/faq-json-strings.py +++ /dev/null @@ -1,5 +0,0 @@ -from aws_durable_execution_sdk_python.serdes import JsonSerDes -from aws_durable_execution_sdk_python.config import StepConfig - -config = StepConfig(serdes=JsonSerDes()) -result = context.step(process_json, json_string, config=config) diff --git a/examples/python/advanced/serialization/faq-pydantic-models.py b/examples/python/advanced/serialization/faq-pydantic-models.py deleted file mode 100644 index 41b639f..0000000 --- a/examples/python/advanced/serialization/faq-pydantic-models.py +++ /dev/null @@ -1,2 +0,0 @@ -order = Order(order_id="ORD-123", amount=99.99) -result = context.step(process_order, order.model_dump()) diff --git a/examples/python/advanced/serialization/faq-serialization-fails.py b/examples/python/advanced/serialization/faq-serialization-fails.py deleted file mode 100644 index f59144c..0000000 --- a/examples/python/advanced/serialization/faq-serialization-fails.py +++ /dev/null @@ -1,7 +0,0 @@ -from aws_durable_execution_sdk_python.exceptions import ExecutionError - -try: - result = context.step(process_data, data) -except ExecutionError as e: - context.logger.error(f"Serialization failed: {e}") - # Handle error or convert data diff --git a/examples/python/advanced/serialization/handle-errors-gracefully.py b/examples/python/advanced/serialization/handle-errors-gracefully.py deleted file mode 100644 index 4b813ea..0000000 --- a/examples/python/advanced/serialization/handle-errors-gracefully.py +++ /dev/null @@ -1,15 +0,0 @@ -from aws_durable_execution_sdk_python.exceptions import ExecutionError - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - try: - result = context.step(process_data, complex_object) - except ExecutionError as e: - if "Serialization failed" in str(e): - # Convert to serializable format - simple_data = convert_to_dict(complex_object) - result = context.step(process_data, simple_data) - else: - raise - - return result diff --git a/examples/python/advanced/serialization/keep-data-small.py b/examples/python/advanced/serialization/keep-data-small.py deleted file mode 100644 index 6b2fd2a..0000000 --- a/examples/python/advanced/serialization/keep-data-small.py +++ /dev/null @@ -1,11 +0,0 @@ -# Good - only checkpoint what you need -result = context.step( - process_data, - {"id": order.id, "amount": order.amount} -) - -# Avoid - large objects in checkpoints -result = context.step( - process_data, - entire_database_dump # Too large -) diff --git a/examples/python/advanced/serialization/large-payload-errors.py b/examples/python/advanced/serialization/large-payload-errors.py deleted file mode 100644 index 800236e..0000000 --- a/examples/python/advanced/serialization/large-payload-errors.py +++ /dev/null @@ -1,10 +0,0 @@ -# Option 1: Reduce data -small_data = {"id": order.id, "status": order.status} -result = context.step(process_order, small_data) - -# Option 2: Use summary generator (for map/parallel) -def generate_summary(result): - return json.dumps({"count": len(result.all)}) - -config = MapConfig(summary_generator=generate_summary) -result = context.map(process_item, items, config=config) diff --git a/examples/python/advanced/serialization/map-parallel-config.py b/examples/python/advanced/serialization/map-parallel-config.py deleted file mode 100644 index 6ad1441..0000000 --- a/examples/python/advanced/serialization/map-parallel-config.py +++ /dev/null @@ -1,15 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution -from aws_durable_execution_sdk_python.config import MapConfig - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - items = [1, 2, 3, 4, 5] - - # Custom serialization for BatchResult - config = MapConfig( - serdes=CustomSerDes(), # For the entire BatchResult - item_serdes=ItemSerDes() # For individual item results - ) - - result = context.map(process_item, items, config=config) - return {"processed": len(result.succeeded)} diff --git a/examples/python/advanced/serialization/primitive-types.py b/examples/python/advanced/serialization/primitive-types.py deleted file mode 100644 index 52af244..0000000 --- a/examples/python/advanced/serialization/primitive-types.py +++ /dev/null @@ -1,22 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - # Primitives - plain JSON - none_value = None - text = "hello" - number = 42 - decimal_num = 3.14 - flag = True - - # Simple lists of primitives - plain JSON - numbers = [1, 2, 3, 4, 5] - - return { - "none": none_value, - "text": text, - "number": number, - "decimal": decimal_num, - "flag": flag, - "numbers": numbers - } diff --git a/examples/python/advanced/serialization/pydantic-models.py b/examples/python/advanced/serialization/pydantic-models.py deleted file mode 100644 index 7050aab..0000000 --- a/examples/python/advanced/serialization/pydantic-models.py +++ /dev/null @@ -1,19 +0,0 @@ -from pydantic import BaseModel -from aws_durable_execution_sdk_python import DurableContext, durable_execution - -class Order(BaseModel): - order_id: str - amount: float - customer: str - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - order = Order( - order_id="ORD-123", - amount=99.99, - customer="Jane Doe" - ) - - # Use model_dump() to convert to dict - result = context.step(process_order, order.model_dump()) - return result diff --git a/examples/python/advanced/serialization/serialization-failed-error.py b/examples/python/advanced/serialization/serialization-failed-error.py deleted file mode 100644 index 1a8de64..0000000 --- a/examples/python/advanced/serialization/serialization-failed-error.py +++ /dev/null @@ -1,6 +0,0 @@ -# Circular reference - fails -data = {"self": None} -data["self"] = data - -# Fix - remove circular reference -data = {"id": 123, "name": "test"} diff --git a/examples/python/advanced/serialization/step-config.py b/examples/python/advanced/serialization/step-config.py deleted file mode 100644 index 243ed73..0000000 --- a/examples/python/advanced/serialization/step-config.py +++ /dev/null @@ -1,8 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution -from aws_durable_execution_sdk_python.config import StepConfig - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - config = StepConfig(serdes=CustomSerDes()) - result = context.step(my_function(), config=config) - return result diff --git a/examples/python/advanced/serialization/test-round-trips.py b/examples/python/advanced/serialization/test-round-trips.py deleted file mode 100644 index b3a7c45..0000000 --- a/examples/python/advanced/serialization/test-round-trips.py +++ /dev/null @@ -1,8 +0,0 @@ -from aws_durable_execution_sdk_python.serdes import serialize, deserialize - -def test_serialization(): - original = {"amount": Decimal("99.99")} - serialized = serialize(None, original, "test-op", "test-arn") - deserialized = deserialize(None, serialized, "test-op", "test-arn") - - assert deserialized == original diff --git a/examples/python/advanced/serialization/type-not-preserved.py b/examples/python/advanced/serialization/type-not-preserved.py deleted file mode 100644 index b408974..0000000 --- a/examples/python/advanced/serialization/type-not-preserved.py +++ /dev/null @@ -1,8 +0,0 @@ -# Default serialization preserves tuple -result = context.step(process_data, (1, 2, 3)) # Stays as tuple - -# If using custom SerDes, ensure it preserves types -class TypePreservingSerDes(SerDes[Any]): - def serialize(self, value: Any, context: SerDesContext) -> str: - # Implement type preservation logic - pass diff --git a/examples/python/advanced/serialization/unsupported-type-error.py b/examples/python/advanced/serialization/unsupported-type-error.py deleted file mode 100644 index eeee660..0000000 --- a/examples/python/advanced/serialization/unsupported-type-error.py +++ /dev/null @@ -1,5 +0,0 @@ -# Before - fails -result = context.step(process_order, order_object) - -# After - works -result = context.step(process_order, order_object.to_dict()) diff --git a/examples/python/advanced/serialization/use-custom-serdes.py b/examples/python/advanced/serialization/use-custom-serdes.py deleted file mode 100644 index 72576af..0000000 --- a/examples/python/advanced/serialization/use-custom-serdes.py +++ /dev/null @@ -1,29 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution, durable_step, StepContext -from aws_durable_execution_sdk_python.config import StepConfig -from aws_durable_execution_sdk_python.serdes import SerDes, SerDesContext -import json - -class CompressedSerDes(SerDes[dict]): - """Example: Compress large dictionaries.""" - - def serialize(self, value: dict, serdes_context: SerDesContext) -> str: - # In production, use actual compression like gzip - return json.dumps(value, separators=(',', ':')) - - def deserialize(self, data: str, serdes_context: SerDesContext) -> dict: - return json.loads(data) - -@durable_step -def process_large_data(step_context: StepContext, data: dict) -> dict: - # Process the data - return {"processed": True, "items": len(data)} - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - large_data = {"items": [f"item_{i}" for i in range(1000)]} - - # Use custom SerDes for this step - config = StepConfig(serdes=CompressedSerDes()) - result = context.step(process_large_data(large_data), config=config) - - return result diff --git a/examples/python/advanced/serialization/use-default-serialization.py b/examples/python/advanced/serialization/use-default-serialization.py deleted file mode 100644 index 9e6e9a0..0000000 --- a/examples/python/advanced/serialization/use-default-serialization.py +++ /dev/null @@ -1,10 +0,0 @@ -# Good - uses default serialization -from datetime import datetime -from decimal import Decimal - -result = context.step( - process_order, - order_id="ORD-123", - amount=Decimal("99.99"), - timestamp=datetime.now() -) diff --git a/examples/python/advanced/testing-modes/appropriate-timeouts.py b/examples/python/advanced/testing-modes/appropriate-timeouts.py deleted file mode 100644 index 3b6acb2..0000000 --- a/examples/python/advanced/testing-modes/appropriate-timeouts.py +++ /dev/null @@ -1,5 +0,0 @@ -# Local mode: short timeout -result = runner.run(input="test", timeout=10) - -# Cloud mode: longer timeout -result = runner.run(input="test", timeout=60) diff --git a/examples/python/advanced/testing-modes/basic-cloud-test.py b/examples/python/advanced/testing-modes/basic-cloud-test.py deleted file mode 100644 index e1324d9..0000000 --- a/examples/python/advanced/testing-modes/basic-cloud-test.py +++ /dev/null @@ -1,16 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python.execution import InvocationStatus -from examples.src import hello_world - - -@pytest.mark.durable_execution( - handler=hello_world.handler, - lambda_function_name="hello world", -) -def test_hello_world(durable_runner): - """Test hello world in both local and cloud modes.""" - with durable_runner: - result = durable_runner.run(input="test", timeout=10) - - assert result.status == InvocationStatus.SUCCEEDED - assert result.result == "Hello World!" diff --git a/examples/python/advanced/testing-modes/custom-timeout.py b/examples/python/advanced/testing-modes/custom-timeout.py deleted file mode 100644 index 412585b..0000000 --- a/examples/python/advanced/testing-modes/custom-timeout.py +++ /dev/null @@ -1,5 +0,0 @@ -def test_long_running(durable_runner): - with durable_runner: - result = durable_runner.run(input="test", timeout=300) # 5 minutes - - assert result.status == InvocationStatus.SUCCEEDED diff --git a/examples/python/advanced/testing-modes/durable-execution-decorator.py b/examples/python/advanced/testing-modes/durable-execution-decorator.py deleted file mode 100644 index 36df6c8..0000000 --- a/examples/python/advanced/testing-modes/durable-execution-decorator.py +++ /dev/null @@ -1,6 +0,0 @@ -from aws_durable_execution_sdk_python import durable_execution, DurableContext - -@durable_execution -def handler(event: dict, context: DurableContext): - # Your durable function code - pass diff --git a/examples/python/advanced/testing-modes/mode-agnostic-tests.py b/examples/python/advanced/testing-modes/mode-agnostic-tests.py deleted file mode 100644 index cbd81a1..0000000 --- a/examples/python/advanced/testing-modes/mode-agnostic-tests.py +++ /dev/null @@ -1,12 +0,0 @@ -@pytest.mark.durable_execution( - handler=my_function.handler, - lambda_function_name="my function", -) -def test_my_function(durable_runner): - """Test works in both local and cloud modes.""" - with durable_runner: - result = durable_runner.run(input={"value": 42}, timeout=10) - - # These assertions work in both modes - assert result.status == InvocationStatus.SUCCEEDED - assert result.result == "expected output" diff --git a/examples/python/advanced/testing-modes/mode-specific-assertions.py b/examples/python/advanced/testing-modes/mode-specific-assertions.py deleted file mode 100644 index 692ad63..0000000 --- a/examples/python/advanced/testing-modes/mode-specific-assertions.py +++ /dev/null @@ -1,10 +0,0 @@ -def test_with_mode_check(durable_runner): - with durable_runner: - result = durable_runner.run(input="test", timeout=10) - - assert result.status == InvocationStatus.SUCCEEDED - - # Cloud-specific validation - if durable_runner.mode == "cloud": - # Additional assertions for cloud environment - pass diff --git a/examples/python/advanced/testing-modes/test-markers.py b/examples/python/advanced/testing-modes/test-markers.py deleted file mode 100644 index fa7b9a0..0000000 --- a/examples/python/advanced/testing-modes/test-markers.py +++ /dev/null @@ -1,7 +0,0 @@ -@pytest.mark.durable_execution( - handler=my_function.handler, # Required for local mode - lambda_function_name="my function", # Required for cloud mode -) -def test_my_function(durable_runner): - # Test code here - pass diff --git a/examples/python/advanced/testing-modes/timeout-error.py b/examples/python/advanced/testing-modes/timeout-error.py deleted file mode 100644 index c80b1c1..0000000 --- a/examples/python/advanced/testing-modes/timeout-error.py +++ /dev/null @@ -1,2 +0,0 @@ -# Increase timeout to 120 seconds -result = runner.run(input="test", timeout=120) diff --git a/examples/python/core/callbacks/basic-callback-testing.py b/examples/python/core/callbacks/basic-callback-testing.py deleted file mode 100644 index b3bc097..0000000 --- a/examples/python/core/callbacks/basic-callback-testing.py +++ /dev/null @@ -1,18 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python_testing import InvocationStatus -from examples.src.callback import callback - -@pytest.mark.durable_execution( - handler=callback.handler, - lambda_function_name="callback", -) -def test_callback(durable_runner): - """Test callback creation.""" - with durable_runner: - result = durable_runner.run(input="test", timeout=10) - - # Check overall status - assert result.status is InvocationStatus.SUCCEEDED - - # Verify callback was created - assert "Callback created with ID:" in result.result diff --git a/examples/python/core/callbacks/basic-example.py b/examples/python/core/callbacks/basic-example.py deleted file mode 100644 index cb17725..0000000 --- a/examples/python/core/callbacks/basic-example.py +++ /dev/null @@ -1,34 +0,0 @@ -from typing import Any -from aws_durable_execution_sdk_python import DurableContext, durable_execution -from aws_durable_execution_sdk_python.config import CallbackConfig, Duration - -@durable_execution -def handler(event: Any, context: DurableContext) -> dict: - """Create a callback and wait for external system response.""" - # Step 1: Create the callback - callback_config = CallbackConfig( - timeout=Duration.from_minutes(2), - heartbeat_timeout=Duration.from_seconds(60), - ) - - callback = context.create_callback( - name="example_callback", - config=callback_config, - ) - - # Step 2: Send callback ID to external system - # In a real scenario, you'd send this to a third-party API, - # message queue, or webhook endpoint - send_to_external_system({ - "callback_id": callback.callback_id, - "data": event.get("data"), - }) - - # Step 3: Wait for the result - execution suspends here - result = callback.result() - - # Step 4: Execution resumes when result is received - return { - "status": "completed", - "result": result, - } diff --git a/examples/python/core/callbacks/callback-config.py b/examples/python/core/callbacks/callback-config.py deleted file mode 100644 index c0dd13b..0000000 --- a/examples/python/core/callbacks/callback-config.py +++ /dev/null @@ -1,17 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution -from aws_durable_execution_sdk_python.config import CallbackConfig, Duration - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - # Configure callback with custom timeouts - config = CallbackConfig( - timeout=Duration.from_seconds(60), - heartbeat_timeout=Duration.from_seconds(30), - ) - - callback = context.create_callback( - name="timeout_callback", - config=config, - ) - - return f"Callback created with 60s timeout: {callback.callback_id}" diff --git a/examples/python/core/callbacks/callback-with-fallback.py b/examples/python/core/callbacks/callback-with-fallback.py deleted file mode 100644 index ca9f2a9..0000000 --- a/examples/python/core/callbacks/callback-with-fallback.py +++ /dev/null @@ -1,24 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Use fallback when callback times out.""" - callback = context.create_callback( - name="primary_service", - config=CallbackConfig(timeout=Duration.from_seconds(30)), - ) - - # Try primary service - send_to_primary_service(callback.callback_id, event["data"]) - - result = callback.result() - - if result is None: - # Primary service timed out, use fallback - fallback_callback = context.create_callback( - name="fallback_service", - config=CallbackConfig(timeout=Duration.from_minutes(2)), - ) - - send_to_fallback_service(fallback_callback.callback_id, event["data"]) - result = fallback_callback.result() - - return {"result": result, "source": "primary" if result else "fallback"} diff --git a/examples/python/core/callbacks/conditional-callback-handling.py b/examples/python/core/callbacks/conditional-callback-handling.py deleted file mode 100644 index 46cf962..0000000 --- a/examples/python/core/callbacks/conditional-callback-handling.py +++ /dev/null @@ -1,26 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Handle callback results conditionally.""" - callback = context.create_callback( - name="conditional_callback", - config=CallbackConfig(timeout=Duration.from_minutes(10)), - ) - - # Send request - send_request(callback.callback_id, event["request_type"]) - - # Wait for result - result = callback.result() - - # Handle different result types - if result is None: - return {"status": "timeout", "message": "No response received"} - - result_type = result.get("type") - - if result_type == "success": - return process_success(result) - elif result_type == "partial": - return process_partial(result) - else: - return process_failure(result) diff --git a/examples/python/core/callbacks/create-callback-signature.py b/examples/python/core/callbacks/create-callback-signature.py deleted file mode 100644 index fe1f5b4..0000000 --- a/examples/python/core/callbacks/create-callback-signature.py +++ /dev/null @@ -1,4 +0,0 @@ -def create_callback( - name: str | None = None, - config: CallbackConfig | None = None, -) -> Callback[T] diff --git a/examples/python/core/callbacks/duration-helpers.py b/examples/python/core/callbacks/duration-helpers.py deleted file mode 100644 index e3f7409..0000000 --- a/examples/python/core/callbacks/duration-helpers.py +++ /dev/null @@ -1,13 +0,0 @@ -from aws_durable_execution_sdk_python.config import Duration - -# Various ways to specify duration -timeout_60s = Duration.from_seconds(60) -timeout_5m = Duration.from_minutes(5) -timeout_2h = Duration.from_hours(2) -timeout_1d = Duration.from_days(1) - -# Use in CallbackConfig -config = CallbackConfig( - timeout=Duration.from_hours(2), - heartbeat_timeout=Duration.from_minutes(15), -) diff --git a/examples/python/core/callbacks/get-callback-id.py b/examples/python/core/callbacks/get-callback-id.py deleted file mode 100644 index 031e5b6..0000000 --- a/examples/python/core/callbacks/get-callback-id.py +++ /dev/null @@ -1 +0,0 @@ -callback_id: str diff --git a/examples/python/core/callbacks/get-callback-result.py b/examples/python/core/callbacks/get-callback-result.py deleted file mode 100644 index 0be595b..0000000 --- a/examples/python/core/callbacks/get-callback-result.py +++ /dev/null @@ -1 +0,0 @@ -def result() -> T | None diff --git a/examples/python/core/callbacks/human-approval-workflow.py b/examples/python/core/callbacks/human-approval-workflow.py deleted file mode 100644 index d4af9c6..0000000 --- a/examples/python/core/callbacks/human-approval-workflow.py +++ /dev/null @@ -1,34 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution -from aws_durable_execution_sdk_python.config import CallbackConfig, Duration - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Process an order that requires approval.""" - order_id = event["order_id"] - - # Create callback for approval - approval_callback = context.create_callback( - name="order_approval", - config=CallbackConfig( - timeout=Duration.from_hours(48), # 48 hours to approve - heartbeat_timeout=Duration.from_hours(12), # Check every 12 hours - ), - ) - - # Send approval request to approval system - # The approval system will use callback.callback_id to respond - send_to_approval_system({ - "callback_id": approval_callback.callback_id, - "order_id": order_id, - "details": event["order_details"], - }) - - # Wait for approval - approval = approval_callback.result() - - if approval and approval.get("approved"): - # Process approved order - return process_order(order_id) - else: - # Handle rejection - return {"status": "rejected", "reason": approval.get("reason")} diff --git a/examples/python/core/callbacks/inspect-callback-operations.py b/examples/python/core/callbacks/inspect-callback-operations.py deleted file mode 100644 index bb00a1c..0000000 --- a/examples/python/core/callbacks/inspect-callback-operations.py +++ /dev/null @@ -1,21 +0,0 @@ -@pytest.mark.durable_execution( - handler=callback.handler, - lambda_function_name="callback", -) -def test_callback_operation(durable_runner): - """Test and inspect callback operation.""" - with durable_runner: - result = durable_runner.run(input="test", timeout=10) - - # Find callback operations - callback_ops = [ - op for op in result.operations - if op.operation_type.value == "CALLBACK" - ] - - assert len(callback_ops) == 1 - callback_op = callback_ops[0] - - # Verify callback properties - assert callback_op.name == "example_callback" - assert callback_op.callback_id is not None diff --git a/examples/python/core/callbacks/message-broker-durable-function.py b/examples/python/core/callbacks/message-broker-durable-function.py deleted file mode 100644 index bf01670..0000000 --- a/examples/python/core/callbacks/message-broker-durable-function.py +++ /dev/null @@ -1,25 +0,0 @@ -# Durable function side -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Process payment with external payment processor.""" - # Create callback - callback = context.create_callback( - name="payment_callback", - config=CallbackConfig(timeout=Duration.from_minutes(5)), - ) - - # Send to message broker (SQS, SNS, EventBridge, etc.) - send_to_payment_queue({ - "callback_id": callback.callback_id, - "amount": event["amount"], - "customer_id": event["customer_id"], - }) - - # Wait for result - execution suspends here - payment_result = callback.result() - - # Execution resumes here when callback is notified - return { - "payment_status": payment_result.get("status"), - "transaction_id": payment_result.get("transaction_id"), - } diff --git a/examples/python/core/callbacks/message-broker-notification-handler.py b/examples/python/core/callbacks/message-broker-notification-handler.py deleted file mode 100644 index 6812a06..0000000 --- a/examples/python/core/callbacks/message-broker-notification-handler.py +++ /dev/null @@ -1,35 +0,0 @@ -# Message processor side (separate Lambda or service) -import boto3 -import json - -lambda_client = boto3.client('lambda') - -def process_payment_message(event: dict): - """Process payment and notify callback.""" - callback_id = event["callback_id"] - amount = event["amount"] - customer_id = event["customer_id"] - - try: - # Process payment with external system - result = payment_processor.charge(customer_id, amount) - - # Notify success - result_data = json.dumps({ - 'status': 'completed', - 'transaction_id': result.transaction_id, - }).encode('utf-8') - - lambda_client.send_durable_execution_callback_success( - CallbackId=callback_id, - Result=result_data - ) - except PaymentError as e: - # Notify failure - lambda_client.send_durable_execution_callback_failure( - CallbackId=callback_id, - Error={ - 'ErrorType': 'PaymentError', - 'ErrorMessage': f'{e.error_code}: {str(e)}' - } - ) diff --git a/examples/python/core/callbacks/multiple-callbacks.py b/examples/python/core/callbacks/multiple-callbacks.py deleted file mode 100644 index fb11287..0000000 --- a/examples/python/core/callbacks/multiple-callbacks.py +++ /dev/null @@ -1,33 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Wait for multiple external systems.""" - # Create callbacks for different systems - credit_check = context.create_callback( - name="credit_check", - config=CallbackConfig(timeout=Duration.from_minutes(5)), - ) - - fraud_check = context.create_callback( - name="fraud_check", - config=CallbackConfig(timeout=Duration.from_minutes(3)), - ) - - # Send requests to external systems - request_credit_check(credit_check.callback_id, event["customer_id"]) - request_fraud_check(fraud_check.callback_id, event["transaction_data"]) - - # Wait for both results - credit_result = credit_check.result() - fraud_result = fraud_check.result() - - # Make decision based on both checks - approved = ( - credit_result.get("score", 0) > 650 and - fraud_result.get("risk_level") == "low" - ) - - return { - "approved": approved, - "credit_score": credit_result.get("score"), - "fraud_risk": fraud_result.get("risk_level"), - } diff --git a/examples/python/core/callbacks/notify-failure.py b/examples/python/core/callbacks/notify-failure.py deleted file mode 100644 index 4f8b51d..0000000 --- a/examples/python/core/callbacks/notify-failure.py +++ /dev/null @@ -1,10 +0,0 @@ -# When external system fails -callback_id = "abc123-callback-id-from-durable-function" - -lambda_client.send_durable_execution_callback_failure( - CallbackId=callback_id, - Error={ - 'ErrorType': 'PaymentDeclined', - 'ErrorMessage': 'Insufficient funds' - } -) diff --git a/examples/python/core/callbacks/notify-success.py b/examples/python/core/callbacks/notify-success.py deleted file mode 100644 index a97b257..0000000 --- a/examples/python/core/callbacks/notify-success.py +++ /dev/null @@ -1,13 +0,0 @@ -import boto3 -import json - -lambda_client = boto3.client('lambda') - -# When external system succeeds -callback_id = "abc123-callback-id-from-durable-function" -result_data = json.dumps({'status': 'approved', 'amount': 1000}).encode('utf-8') - -lambda_client.send_durable_execution_callback_success( - CallbackId=callback_id, - Result=result_data -) diff --git a/examples/python/core/callbacks/payment-processing.py b/examples/python/core/callbacks/payment-processing.py deleted file mode 100644 index f420e51..0000000 --- a/examples/python/core/callbacks/payment-processing.py +++ /dev/null @@ -1,31 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Process a payment with external processor.""" - amount = event["amount"] - customer_id = event["customer_id"] - - # Create callback for payment result - payment_callback = context.create_callback( - name="payment_processing", - config=CallbackConfig( - timeout=Duration.from_minutes(5), - heartbeat_timeout=Duration.from_seconds(30), - ), - ) - - # Initiate payment with external processor - initiate_payment_with_processor({ - "callback_id": payment_callback.callback_id, - "amount": amount, - "customer_id": customer_id, - "callback_url": f"https://api.example.com/callbacks/{payment_callback.callback_id}", - }) - - # Wait for payment result - payment_result = payment_callback.result() - - return { - "transaction_id": payment_result.get("transaction_id"), - "status": payment_result.get("status"), - "amount": amount, - } diff --git a/examples/python/core/callbacks/send-heartbeat.py b/examples/python/core/callbacks/send-heartbeat.py deleted file mode 100644 index 412f56a..0000000 --- a/examples/python/core/callbacks/send-heartbeat.py +++ /dev/null @@ -1,6 +0,0 @@ -# Send heartbeat for long-running operations -callback_id = "abc123-callback-id-from-durable-function" - -lambda_client.send_durable_execution_callback_heartbeat( - CallbackId=callback_id -) diff --git a/examples/python/core/callbacks/test-callback-timeout.py b/examples/python/core/callbacks/test-callback-timeout.py deleted file mode 100644 index 8ce3b6f..0000000 --- a/examples/python/core/callbacks/test-callback-timeout.py +++ /dev/null @@ -1,13 +0,0 @@ -from examples.src.callback import callback_with_timeout - -@pytest.mark.durable_execution( - handler=callback_with_timeout.handler, - lambda_function_name="callback_timeout", -) -def test_callback_timeout(durable_runner): - """Test callback with custom timeout.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED - assert "60s timeout" in result.result diff --git a/examples/python/core/callbacks/test-integration-workflow.py b/examples/python/core/callbacks/test-integration-workflow.py deleted file mode 100644 index c5262e3..0000000 --- a/examples/python/core/callbacks/test-integration-workflow.py +++ /dev/null @@ -1,22 +0,0 @@ -@pytest.mark.durable_execution( - handler=approval_workflow_handler, - lambda_function_name="approval_workflow", -) -def test_approval_workflow(durable_runner): - """Test approval workflow with callback.""" - with durable_runner: - result = durable_runner.run( - input={"order_id": "order-123", "amount": 1000}, - timeout=30, - ) - - # Verify workflow completed - assert result.status is InvocationStatus.SUCCEEDED - - # Check callback was created - callback_ops = [ - op for op in result.operations - if op.operation_type.value == "CALLBACK" - ] - assert len(callback_ops) == 1 - assert callback_ops[0].name == "order_approval" diff --git a/examples/python/core/callbacks/third-party-api-integration.py b/examples/python/core/callbacks/third-party-api-integration.py deleted file mode 100644 index 82b767b..0000000 --- a/examples/python/core/callbacks/third-party-api-integration.py +++ /dev/null @@ -1,27 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Integrate with third-party data enrichment API.""" - user_data = event["user_data"] - - # Create callback for enrichment result - enrichment_callback = context.create_callback( - name="data_enrichment", - config=CallbackConfig(timeout=Duration.from_minutes(10)), - ) - - # Request data enrichment from third-party - request_data_enrichment({ - "callback_id": enrichment_callback.callback_id, - "user_data": user_data, - "webhook_url": f"https://api.example.com/webhooks/{enrichment_callback.callback_id}", - }) - - # Wait for enriched data - enriched_data = enrichment_callback.result() - - # Combine original and enriched data - return { - "original": user_data, - "enriched": enriched_data, - "timestamp": enriched_data.get("processed_at"), - } diff --git a/examples/python/core/callbacks/wait-for-external-system.py b/examples/python/core/callbacks/wait-for-external-system.py deleted file mode 100644 index 22f9436..0000000 --- a/examples/python/core/callbacks/wait-for-external-system.py +++ /dev/null @@ -1,49 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, - durable_step, - StepContext, -) -from aws_durable_execution_sdk_python.config import ( - CallbackConfig, - Duration, - StepConfig, -) -from aws_durable_execution_sdk_python.retries import ( - RetryStrategyConfig, - create_retry_strategy, -) - -@durable_step -def wait_for_external_system( - step_context: StepContext, - callback_id: str, -) -> dict: - """Wait for external system with retry on timeout.""" - # This will retry if the callback times out - result = context.wait_for_callback( - callback_id, - config=CallbackConfig(timeout=Duration.from_minutes(2)), - ) - return result - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - # Create callback - callback = context.create_callback(name="external_api") - - # Send request - send_external_request(callback.callback_id) - - # Wait with retry - retry_config = RetryStrategyConfig( - max_attempts=3, - initial_delay_seconds=5, - ) - - result = context.step( - wait_for_external_system(callback.callback_id), - config=StepConfig(retry_strategy=create_retry_strategy(retry_config)), - ) - - return result diff --git a/examples/python/core/callbacks/wait-using-result.py b/examples/python/core/callbacks/wait-using-result.py deleted file mode 100644 index f7b08a8..0000000 --- a/examples/python/core/callbacks/wait-using-result.py +++ /dev/null @@ -1,21 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution -from aws_durable_execution_sdk_python.config import CallbackConfig, Duration - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - # Create callback - callback = context.create_callback( - name="approval_callback", - config=CallbackConfig(timeout=Duration.from_hours(24)), - ) - - # Send callback ID to approval system - send_approval_request(callback.callback_id, event["request_details"]) - - # Wait for approval response - approval_result = callback.result() - - if approval_result and approval_result.get("approved"): - return {"status": "approved", "details": approval_result} - else: - return {"status": "rejected"} diff --git a/examples/python/core/callbacks/wait-using-wait-for-callback.py b/examples/python/core/callbacks/wait-using-wait-for-callback.py deleted file mode 100644 index 2697c0b..0000000 --- a/examples/python/core/callbacks/wait-using-wait-for-callback.py +++ /dev/null @@ -1,15 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - # Create callback - callback = context.create_callback(name="payment_callback") - - # Send to payment processor - initiate_payment(callback.callback_id, event["amount"]) - - # Wait for payment result - payment_result = context.wait_for_callback( - callback.callback_id, - config=CallbackConfig(timeout=Duration.from_minutes(5)), - ) - - return {"payment_status": payment_result} diff --git a/examples/python/core/invoke/handle-invocation-error.py b/examples/python/core/invoke/handle-invocation-error.py deleted file mode 100644 index 08d59ba..0000000 --- a/examples/python/core/invoke/handle-invocation-error.py +++ /dev/null @@ -1,24 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, - CallableRuntimeError, -) - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Handle errors from invoked functions.""" - try: - result = context.invoke( - function_name="risky-function", - payload=event, - name="risky_operation", - ) - return {"status": "success", "result": result} - - except CallableRuntimeError as e: - # Handle the error from the invoked function - context.logger.error(f"Invoked function failed: {e}") - return { - "status": "failed", - "error": str(e), - } diff --git a/examples/python/core/invoke/handle-timeout-error.py b/examples/python/core/invoke/handle-timeout-error.py deleted file mode 100644 index f3e4f3a..0000000 --- a/examples/python/core/invoke/handle-timeout-error.py +++ /dev/null @@ -1,20 +0,0 @@ -from aws_durable_execution_sdk_python.config import Duration, InvokeConfig - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Handle timeout errors.""" - config = InvokeConfig(timeout=Duration.from_seconds(30)) - - try: - result = context.invoke( - function_name="slow-function", - payload=event, - config=config, - ) - return {"status": "success", "result": result} - - except CallableRuntimeError as e: - if "timed out" in str(e).lower(): - context.logger.warning("Function timed out, using fallback") - return {"status": "timeout", "fallback": True} - raise diff --git a/examples/python/core/invoke/invoke-method-signature.py b/examples/python/core/invoke/invoke-method-signature.py deleted file mode 100644 index 4c1d42a..0000000 --- a/examples/python/core/invoke/invoke-method-signature.py +++ /dev/null @@ -1,6 +0,0 @@ -def invoke( - function_name: str, - payload: P, - name: str | None = None, - config: InvokeConfig[P, R] | None = None, -) -> R diff --git a/examples/python/core/invoke/invoke-ondemand-function.py b/examples/python/core/invoke/invoke-ondemand-function.py deleted file mode 100644 index a844551..0000000 --- a/examples/python/core/invoke/invoke-ondemand-function.py +++ /dev/null @@ -1,30 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Invoke a mix of durable and on-demand functions.""" - user_id = event["user_id"] - - # Invoke a regular Lambda function for data fetching - user_data = context.invoke( - function_name="fetch-user-data", # Regular Lambda function - payload={"user_id": user_id}, - name="fetch_user", - ) - - # Invoke a durable function for complex processing - processed = context.invoke( - function_name="process-user-workflow", # Durable function - payload=user_data, - name="process_user", - ) - - # Invoke another regular Lambda for notifications - notification = context.invoke( - function_name="send-notification", # Regular Lambda function - payload={"user_id": user_id, "data": processed}, - name="send_notification", - ) - - return { - "status": "completed", - "notification_sent": notification["sent"], - } diff --git a/examples/python/core/invoke/invoke-service.py b/examples/python/core/invoke/invoke-service.py deleted file mode 100644 index fcba360..0000000 --- a/examples/python/core/invoke/invoke-service.py +++ /dev/null @@ -1,25 +0,0 @@ -from aws_durable_execution_sdk_python import durable_step, StepContext - -@durable_step -def invoke_service(step_context: StepContext, service_name: str, data: dict) -> dict: - """Invoke a service and return its result.""" - # Note: This is a simplified example. In practice, you'd need access to context - # which isn't directly available in step functions. - return {"service": service_name, "result": data} - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Fan out to multiple services.""" - services = ["service-a", "service-b", "service-c"] - - # Invoke each service sequentially - results = [] - for service in services: - result = context.invoke( - function_name=service, - payload=event, - name=f"invoke_{service}", - ) - results.append(result) - - return {"results": results} diff --git a/examples/python/core/invoke/invoke-with-config.py b/examples/python/core/invoke/invoke-with-config.py deleted file mode 100644 index 46e12b6..0000000 --- a/examples/python/core/invoke/invoke-with-config.py +++ /dev/null @@ -1,21 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, -) -from aws_durable_execution_sdk_python.config import Duration, InvokeConfig - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - # Configure invoke with timeout - invoke_config = InvokeConfig( - timeout=Duration.from_minutes(5), - ) - - result = context.invoke( - function_name="long-running-function", - payload=event, - name="long_running", - config=invoke_config, - ) - - return result diff --git a/examples/python/core/invoke/orchestrate-workflow.py b/examples/python/core/invoke/orchestrate-workflow.py deleted file mode 100644 index d7991af..0000000 --- a/examples/python/core/invoke/orchestrate-workflow.py +++ /dev/null @@ -1,27 +0,0 @@ -@durable_execution -def orchestrate_workflow(event: dict, context: DurableContext) -> dict: - """Orchestrate a multi-step workflow.""" - user_id = event["user_id"] - - # Step 1: Fetch user data - user = context.invoke( - function_name="fetch-user", - payload={"user_id": user_id}, - name="fetch_user", - ) - - # Step 2: Enrich user data - enriched_user = context.invoke( - function_name="enrich-user-data", - payload=user, - name="enrich_user", - ) - - # Step 3: Generate report - report = context.invoke( - function_name="generate-report", - payload=enriched_user, - name="generate_report", - ) - - return report diff --git a/examples/python/core/invoke/parent-workflow.py b/examples/python/core/invoke/parent-workflow.py deleted file mode 100644 index 9e67907..0000000 --- a/examples/python/core/invoke/parent-workflow.py +++ /dev/null @@ -1,27 +0,0 @@ -@durable_execution -def parent_workflow(event: dict, context: DurableContext) -> dict: - """Parent workflow that coordinates sub-workflows.""" - project_id = event["project_id"] - - # Invoke sub-workflow for data collection - data = context.invoke( - function_name="collect-data-workflow", - payload={"project_id": project_id}, - name="collect_data", - ) - - # Invoke sub-workflow for data processing - processed = context.invoke( - function_name="process-data-workflow", - payload=data, - name="process_data", - ) - - # Invoke sub-workflow for reporting - report = context.invoke( - function_name="generate-report-workflow", - payload=processed, - name="generate_report", - ) - - return report diff --git a/examples/python/core/invoke/pass-context-between-invocations.py b/examples/python/core/invoke/pass-context-between-invocations.py deleted file mode 100644 index 728dbdd..0000000 --- a/examples/python/core/invoke/pass-context-between-invocations.py +++ /dev/null @@ -1,31 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Pass context between invocations.""" - # First invocation creates context - initial_context = context.invoke( - function_name="initialize-context", - payload=event, - name="initialize", - ) - - # Second invocation uses the context - processed = context.invoke( - function_name="process-with-context", - payload={ - "data": event["data"], - "context": initial_context, - }, - name="process", - ) - - # Third invocation finalizes - final_result = context.invoke( - function_name="finalize", - payload={ - "processed": processed, - "context": initial_context, - }, - name="finalize", - ) - - return final_result diff --git a/examples/python/core/invoke/pass-result-between-invokes.py b/examples/python/core/invoke/pass-result-between-invokes.py deleted file mode 100644 index b790fd6..0000000 --- a/examples/python/core/invoke/pass-result-between-invokes.py +++ /dev/null @@ -1,2 +0,0 @@ -result1 = context.invoke("function-1", payload1) -result2 = context.invoke("function-2", result1) diff --git a/examples/python/core/invoke/process-document.py b/examples/python/core/invoke/process-document.py deleted file mode 100644 index 0208309..0000000 --- a/examples/python/core/invoke/process-document.py +++ /dev/null @@ -1,26 +0,0 @@ -@durable_execution -def process_document(event: dict, context: DurableContext) -> dict: - """Process a document based on its type.""" - document_type = event["document_type"] - document_data = event["data"] - - if document_type == "pdf": - result = context.invoke( - function_name="process-pdf", - payload=document_data, - name="process_pdf", - ) - elif document_type == "image": - result = context.invoke( - function_name="process-image", - payload=document_data, - name="process_image", - ) - else: - result = context.invoke( - function_name="process-generic", - payload=document_data, - name="process_generic", - ) - - return result diff --git a/examples/python/core/invoke/process-order.py b/examples/python/core/invoke/process-order.py deleted file mode 100644 index 7230240..0000000 --- a/examples/python/core/invoke/process-order.py +++ /dev/null @@ -1,33 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, -) - -@durable_execution -def process_order(event: dict, context: DurableContext) -> dict: - """Process an order by validating and charging.""" - order_id = event["order_id"] - amount = event["amount"] - - # Invoke validation function - validation_result = context.invoke( - function_name="validate-order", - payload={"order_id": order_id}, - name="validate_order", - ) - - if not validation_result["valid"]: - return {"status": "rejected", "reason": validation_result["reason"]} - - # Invoke payment function - payment_result = context.invoke( - function_name="process-payment", - payload={"order_id": order_id, "amount": amount}, - name="process_payment", - ) - - return { - "status": "completed", - "order_id": order_id, - "transaction_id": payment_result["transaction_id"], - } diff --git a/examples/python/core/invoke/retry-example-10.py b/examples/python/core/invoke/retry-example-10.py deleted file mode 100644 index 7b36b0a..0000000 --- a/examples/python/core/invoke/retry-example-10.py +++ /dev/null @@ -1,26 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Retry failed invocations.""" - max_retries = 3 - - for attempt in range(max_retries): - try: - result = context.invoke( - function_name="unreliable-function", - payload=event, - name=f"attempt_{attempt + 1}", - ) - return {"status": "success", "result": result, "attempts": attempt + 1} - - except CallableRuntimeError as e: - if attempt == max_retries - 1: - # Last attempt failed - return { - "status": "failed", - "error": str(e), - "attempts": max_retries, - } - # Wait before retrying - context.wait(Duration.from_seconds(2 ** attempt)) - - return {"status": "failed", "reason": "max_retries_exceeded"} diff --git a/examples/python/core/invoke/serialize.py b/examples/python/core/invoke/serialize.py deleted file mode 100644 index 43c5b88..0000000 --- a/examples/python/core/invoke/serialize.py +++ /dev/null @@ -1,30 +0,0 @@ -from aws_durable_execution_sdk_python.config import InvokeConfig -from aws_durable_execution_sdk_python.serdes import SerDes - -class CustomSerDes(SerDes): - """Custom serialization for complex objects.""" - - def serialize(self, value): - # Custom serialization logic - return json.dumps({"custom": value}) - - def deserialize(self, data: str): - # Custom deserialization logic - obj = json.loads(data) - return obj["custom"] - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Use custom serialization.""" - config = InvokeConfig( - serdes_payload=CustomSerDes(), - serdes_result=CustomSerDes(), - ) - - result = context.invoke( - function_name="custom-function", - payload={"complex": "data"}, - config=config, - ) - - return result diff --git a/examples/python/core/invoke/set-timeout.py b/examples/python/core/invoke/set-timeout.py deleted file mode 100644 index 8b65a10..0000000 --- a/examples/python/core/invoke/set-timeout.py +++ /dev/null @@ -1,10 +0,0 @@ -from aws_durable_execution_sdk_python.config import Duration, InvokeConfig - -# Timeout after 30 seconds -config = InvokeConfig(timeout=Duration.from_seconds(30)) - -# Timeout after 5 minutes -config = InvokeConfig(timeout=Duration.from_minutes(5)) - -# Timeout after 2 hours -config = InvokeConfig(timeout=Duration.from_hours(2)) diff --git a/examples/python/core/invoke/test-basic-invoke.py b/examples/python/core/invoke/test-basic-invoke.py deleted file mode 100644 index 1c23af4..0000000 --- a/examples/python/core/invoke/test-basic-invoke.py +++ /dev/null @@ -1,21 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python_testing import InvocationStatus -from my_function import handler - -@pytest.mark.durable_execution( - handler=handler, - lambda_function_name="my_function", -) -def test_invoke(durable_runner): - """Test a function with invoke operations.""" - with durable_runner: - result = durable_runner.run( - input={"order_id": "order-123", "amount": 100.0}, - timeout=30, - ) - - # Check overall status - assert result.status is InvocationStatus.SUCCEEDED - - # Check final result - assert result.result["status"] == "completed" diff --git a/examples/python/core/invoke/test-error-handling.py b/examples/python/core/invoke/test-error-handling.py deleted file mode 100644 index aa0b5eb..0000000 --- a/examples/python/core/invoke/test-error-handling.py +++ /dev/null @@ -1,13 +0,0 @@ -@pytest.mark.durable_execution( - handler=handler_with_error_handling, - lambda_function_name="error_handler_function", -) -def test_invoke_error_handling(durable_runner): - """Test invoke error handling.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=30) - - # Function should handle the error gracefully - assert result.status is InvocationStatus.SUCCEEDED - assert result.result["status"] == "failed" - assert "error" in result.result diff --git a/examples/python/core/invoke/test-inspect-invoke.py b/examples/python/core/invoke/test-inspect-invoke.py deleted file mode 100644 index 0905924..0000000 --- a/examples/python/core/invoke/test-inspect-invoke.py +++ /dev/null @@ -1,21 +0,0 @@ -@pytest.mark.durable_execution( - handler=handler, - lambda_function_name="my_function", -) -def test_invoke_operations(durable_runner): - """Test and inspect invoke operations.""" - with durable_runner: - result = durable_runner.run(input={"user_id": "user-123"}, timeout=30) - - # Get all operations - operations = result.operations - - # Find invoke operations - invoke_ops = [op for op in operations if op.operation_type == "CHAINED_INVOKE"] - - # Verify invoke operations were created - assert len(invoke_ops) == 2 - - # Check specific invoke operation - validate_op = next(op for op in invoke_ops if op.name == "validate_order") - assert validate_op.status is InvocationStatus.SUCCEEDED diff --git a/examples/python/core/invoke/test-mock-invoked-functions.py b/examples/python/core/invoke/test-mock-invoked-functions.py deleted file mode 100644 index 12c521a..0000000 --- a/examples/python/core/invoke/test-mock-invoked-functions.py +++ /dev/null @@ -1,19 +0,0 @@ -from unittest.mock import Mock, patch - -@pytest.mark.durable_execution( - handler=handler, - lambda_function_name="my_function", -) -def test_invoke_with_mock(durable_runner): - """Test invoke with mocked function.""" - # The testing framework handles invocations internally - # You can test the orchestration logic without deploying all functions - - with durable_runner: - result = durable_runner.run( - input={"order_id": "order-123"}, - timeout=30, - ) - - # Verify the orchestration logic - assert result.status is InvocationStatus.SUCCEEDED diff --git a/examples/python/core/invoke/test-timeout-handling.py b/examples/python/core/invoke/test-timeout-handling.py deleted file mode 100644 index f5c1e88..0000000 --- a/examples/python/core/invoke/test-timeout-handling.py +++ /dev/null @@ -1,14 +0,0 @@ -from aws_durable_execution_sdk_python.config import Duration, InvokeConfig - -@pytest.mark.durable_execution( - handler=handler_with_timeout, - lambda_function_name="timeout_function", -) -def test_invoke_timeout(durable_runner): - """Test invoke timeout handling.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=60) - - # Check that timeout was handled - assert result.status is InvocationStatus.SUCCEEDED - assert result.result["status"] == "timeout" diff --git a/examples/python/core/logger/add-custom-metadata.py b/examples/python/core/logger/add-custom-metadata.py deleted file mode 100644 index 434c800..0000000 --- a/examples/python/core/logger/add-custom-metadata.py +++ /dev/null @@ -1,24 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - order_id = event.get("order_id") - - context.logger.info( - "Processing order", - extra={ - "order_id": order_id, - "customer_id": event.get("customer_id"), - "priority": "high" - } - ) - - result: str = context.step( - lambda _: f"order-{order_id}-processed", - name="process_order", - ) - - context.logger.info( - "Order completed", - extra={"order_id": order_id, "result": result} - ) - - return result diff --git a/examples/python/core/logger/automatic-context-enrichment.py b/examples/python/core/logger/automatic-context-enrichment.py deleted file mode 100644 index 238449a..0000000 --- a/examples/python/core/logger/automatic-context-enrichment.py +++ /dev/null @@ -1,14 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - # This log includes: execution_arn - context.logger.info("Top-level log") - - result: str = context.step( - lambda _: "processed", - name="process_data", - ) - - # This log includes: execution_arn, parent_id, name, attempt - context.logger.info("Step completed") - - return result diff --git a/examples/python/core/logger/avoid-sensitive-data.py b/examples/python/core/logger/avoid-sensitive-data.py deleted file mode 100644 index 858466c..0000000 --- a/examples/python/core/logger/avoid-sensitive-data.py +++ /dev/null @@ -1,5 +0,0 @@ -# Good - log identifiers only -context.logger.info("User authenticated", extra={"user_id": user_id}) - -# Avoid - don't log sensitive data -context.logger.info("User authenticated", extra={"password": password}) diff --git a/examples/python/core/logger/basic-usage.py b/examples/python/core/logger/basic-usage.py deleted file mode 100644 index 73b74b7..0000000 --- a/examples/python/core/logger/basic-usage.py +++ /dev/null @@ -1,15 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - # Log at the top level - context.logger.info("Starting workflow", extra={"event_id": event.get("id")}) - - # Execute a step - result: str = context.step( - lambda _: "processed", - name="process_data", - ) - - context.logger.info("Workflow completed", extra={"result": result}) - return result diff --git a/examples/python/core/logger/child-workflow.py b/examples/python/core/logger/child-workflow.py deleted file mode 100644 index 5710799..0000000 --- a/examples/python/core/logger/child-workflow.py +++ /dev/null @@ -1,33 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, - durable_with_child_context, -) - -@durable_with_child_context -def child_workflow(ctx: DurableContext) -> str: - # Logger includes parent_id for the child context - ctx.logger.info("Running in child context") - - # Step in child context has nested parent_id - child_result: str = ctx.step( - lambda _: "child-processed", - name="child_step", - ) - - ctx.logger.info("Child workflow completed", extra={"result": child_result}) - return child_result - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - # Top-level logger: only execution_arn - context.logger.info("Starting workflow", extra={"event_id": event.get("id")}) - - # Child context inherits logger and adds its own parent_id - result: str = context.run_in_child_context( - child_workflow(), - name="child_workflow" - ) - - context.logger.info("Workflow completed", extra={"result": result}) - return result diff --git a/examples/python/core/logger/context-logger-deduplication.py b/examples/python/core/logger/context-logger-deduplication.py deleted file mode 100644 index 3ae0aaa..0000000 --- a/examples/python/core/logger/context-logger-deduplication.py +++ /dev/null @@ -1,22 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - # This log appears only once, even if the function is replayed - context.logger.info("Starting workflow") - - # Step 1 - logs appear only once - result1: str = context.step( - lambda _: "step1-done", - name="step_1", - ) - context.logger.info("Step 1 completed", extra={"result": result1}) - - # Step 2 - logs appear only once - result2: str = context.step( - lambda _: "step2-done", - name="step_2", - ) - context.logger.info("Step 2 completed", extra={"result": result2}) - - return f"{result1}-{result2}" diff --git a/examples/python/core/logger/direct-logger-duplicates.py b/examples/python/core/logger/direct-logger-duplicates.py deleted file mode 100644 index 7027857..0000000 --- a/examples/python/core/logger/direct-logger-duplicates.py +++ /dev/null @@ -1,25 +0,0 @@ -from aws_lambda_powertools import Logger -from aws_durable_execution_sdk_python import DurableContext, durable_execution - -logger = Logger(service="order-processing") - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - # This log appears on every replay - logger.info("Starting workflow") - - result1: str = context.step( - lambda _: "step1-done", - name="step_1", - ) - # This log appears on every replay after step 1 - logger.info("Step 1 completed") - - result2: str = context.step( - lambda _: "step2-done", - name="step_2", - ) - # This log appears only once (no more replays after this) - logger.info("Step 2 completed") - - return f"{result1}-{result2}" diff --git a/examples/python/core/logger/include-business-context.py b/examples/python/core/logger/include-business-context.py deleted file mode 100644 index a9f2db3..0000000 --- a/examples/python/core/logger/include-business-context.py +++ /dev/null @@ -1,8 +0,0 @@ -context.logger.info( - "Processing payment", - extra={ - "order_id": order_id, - "customer_id": customer_id, - "payment_method": "credit_card" - } -) diff --git a/examples/python/core/logger/integrate-powertools-context.py b/examples/python/core/logger/integrate-powertools-context.py deleted file mode 100644 index 848af18..0000000 --- a/examples/python/core/logger/integrate-powertools-context.py +++ /dev/null @@ -1,20 +0,0 @@ -from aws_lambda_powertools import Logger -from aws_durable_execution_sdk_python import DurableContext, durable_execution - -logger = Logger(service="order-processing") - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - # Set Powertools for AWS Lambda (Python) on the context - context.set_logger(logger) - - # Now context.logger uses Powertools for AWS Lambda (Python) with automatic enrichment - context.logger.info("Starting workflow", extra={"event_id": event.get("id")}) - - result: str = context.step( - lambda _: "processed", - name="process_data", - ) - - context.logger.info("Workflow completed", extra={"result": result}) - return result diff --git a/examples/python/core/logger/lambda-log-controls.py b/examples/python/core/logger/lambda-log-controls.py deleted file mode 100644 index 30a540f..0000000 --- a/examples/python/core/logger/lambda-log-controls.py +++ /dev/null @@ -1,11 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - context.logger.debug("This won't appear if log level is INFO or higher") - context.logger.info("This will appear") - - result: str = context.step( - lambda _: "processed", - name="process_data", - ) - - return result diff --git a/examples/python/core/logger/logger-interface-protocol.py b/examples/python/core/logger/logger-interface-protocol.py deleted file mode 100644 index a03e44a..0000000 --- a/examples/python/core/logger/logger-interface-protocol.py +++ /dev/null @@ -1,23 +0,0 @@ -from typing import Protocol -from collections.abc import Mapping - -class LoggerInterface(Protocol): - def debug( - self, msg: object, *args: object, extra: Mapping[str, object] | None = None - ) -> None: ... - - def info( - self, msg: object, *args: object, extra: Mapping[str, object] | None = None - ) -> None: ... - - def warning( - self, msg: object, *args: object, extra: Mapping[str, object] | None = None - ) -> None: ... - - def error( - self, msg: object, *args: object, extra: Mapping[str, object] | None = None - ) -> None: ... - - def exception( - self, msg: object, *args: object, extra: Mapping[str, object] | None = None - ) -> None: ... diff --git a/examples/python/core/logger/logger-method-signature.py b/examples/python/core/logger/logger-method-signature.py deleted file mode 100644 index 5c3439b..0000000 --- a/examples/python/core/logger/logger-method-signature.py +++ /dev/null @@ -1,5 +0,0 @@ -context.logger.debug(msg, *args, extra=None) -context.logger.info(msg, *args, extra=None) -context.logger.warning(msg, *args, extra=None) -context.logger.error(msg, *args, extra=None) -context.logger.exception(msg, *args, extra=None) diff --git a/examples/python/core/logger/powertools-with-deduplication.py b/examples/python/core/logger/powertools-with-deduplication.py deleted file mode 100644 index e64edf8..0000000 --- a/examples/python/core/logger/powertools-with-deduplication.py +++ /dev/null @@ -1,28 +0,0 @@ -from aws_lambda_powertools import Logger -from aws_durable_execution_sdk_python import DurableContext, durable_execution - -logger = Logger(service="order-processing") - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - # Set Powertools for AWS Lambda (Python) on the context - context.set_logger(logger) - - # Now you get BOTH: - # - Powertools for AWS Lambda (Python) features (JSON logging, correlation IDs, etc.) - # - Log deduplication during replays - context.logger.info("Starting workflow") - - result1: str = context.step( - lambda _: "step1-done", - name="step_1", - ) - context.logger.info("Step 1 completed", extra={"result": result1}) - - result2: str = context.step( - lambda _: "step2-done", - name="step_2", - ) - context.logger.info("Step 2 completed", extra={"result": result2}) - - return f"{result1}-{result2}" diff --git a/examples/python/core/logger/selective-logging.py b/examples/python/core/logger/selective-logging.py deleted file mode 100644 index 4d6d0d3..0000000 --- a/examples/python/core/logger/selective-logging.py +++ /dev/null @@ -1,8 +0,0 @@ -import logging - -# Silence all SDK logs -logging.getLogger("aws_durable_execution_sdk_python").setLevel(logging.WARNING) - -# Or silence specific modules only -logging.getLogger("aws_durable_execution_sdk_python.state").setLevel(logging.WARNING) -logging.getLogger("aws_durable_execution_sdk_python.concurrency").setLevel(logging.WARNING) diff --git a/examples/python/core/logger/set-powertools-log-level.py b/examples/python/core/logger/set-powertools-log-level.py deleted file mode 100644 index 7541b7f..0000000 --- a/examples/python/core/logger/set-powertools-log-level.py +++ /dev/null @@ -1,2 +0,0 @@ -from aws_lambda_powertools import Logger -logger = Logger(service="my-service", level="DEBUG") diff --git a/examples/python/core/logger/set-standard-log-level.py b/examples/python/core/logger/set-standard-log-level.py deleted file mode 100644 index 5c136b3..0000000 --- a/examples/python/core/logger/set-standard-log-level.py +++ /dev/null @@ -1,2 +0,0 @@ -import logging -logging.basicConfig(level=logging.DEBUG) diff --git a/examples/python/core/logger/silence-botocore.py b/examples/python/core/logger/silence-botocore.py deleted file mode 100644 index 86afc07..0000000 --- a/examples/python/core/logger/silence-botocore.py +++ /dev/null @@ -1,5 +0,0 @@ -import logging - -# Silence botocore/urllib3 noise -logging.getLogger("botocore").setLevel(logging.WARNING) -logging.getLogger("urllib3").setLevel(logging.WARNING) diff --git a/examples/python/core/logger/structured-logging-extra.py b/examples/python/core/logger/structured-logging-extra.py deleted file mode 100644 index 44a3046..0000000 --- a/examples/python/core/logger/structured-logging-extra.py +++ /dev/null @@ -1,5 +0,0 @@ -# Good - structured and queryable -context.logger.info("Order processed", extra={"order_id": order_id, "amount": 100}) - -# Avoid - harder to query -context.logger.info(f"Order {order_id} processed with amount 100") diff --git a/examples/python/core/logger/test-basic-logger.py b/examples/python/core/logger/test-basic-logger.py deleted file mode 100644 index ec6e89a..0000000 --- a/examples/python/core/logger/test-basic-logger.py +++ /dev/null @@ -1,17 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python.execution import InvocationStatus - -from src.logger_example import logger_example -from test.conftest import deserialize_operation_payload - -@pytest.mark.durable_execution( - handler=logger_example.handler, - lambda_function_name="logger example", -) -def test_logger_example(durable_runner): - """Test logger example.""" - with durable_runner: - result = durable_runner.run(input={"id": "test-123"}, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED - assert deserialize_operation_payload(result.result) == "processed-child-processed" diff --git a/examples/python/core/logger/test-verify-log-output.py b/examples/python/core/logger/test-verify-log-output.py deleted file mode 100644 index 927497e..0000000 --- a/examples/python/core/logger/test-verify-log-output.py +++ /dev/null @@ -1,16 +0,0 @@ -import logging -import pytest -from aws_durable_execution_sdk_python.execution import InvocationStatus - -@pytest.mark.durable_execution(handler=my_handler) -def test_logging_output(durable_runner, caplog): - """Test that expected log messages are emitted.""" - with caplog.at_level(logging.INFO): - with durable_runner: - result = durable_runner.run(input={"id": "test-123"}, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED - - # Verify log messages - assert "Starting workflow" in caplog.text - assert "Workflow completed" in caplog.text diff --git a/examples/python/core/logger/test-with-powertools.py b/examples/python/core/logger/test-with-powertools.py deleted file mode 100644 index 500a2e5..0000000 --- a/examples/python/core/logger/test-with-powertools.py +++ /dev/null @@ -1,24 +0,0 @@ -import json -import pytest -from aws_lambda_powertools import Logger - -@pytest.mark.durable_execution(handler=my_handler) -def test_powertools_logging(durable_runner, caplog): - """Test Powertools for AWS Lambda (Python) integration.""" - logger = Logger(service="test-service") - - with caplog.at_level(logging.INFO): - with durable_runner: - result = durable_runner.run(input={"id": "test-123"}, timeout=10) - - # Parse JSON log entries - for record in caplog.records: - if hasattr(record, 'msg'): - try: - log_entry = json.loads(record.msg) - # Verify Powertools for AWS Lambda (Python) fields - assert "service" in log_entry - # Verify SDK enrichment fields - assert "execution_arn" in log_entry - except json.JSONDecodeError: - pass # Not a JSON log entry diff --git a/examples/python/core/logger/use-powertools-directly.py b/examples/python/core/logger/use-powertools-directly.py deleted file mode 100644 index 4151ed8..0000000 --- a/examples/python/core/logger/use-powertools-directly.py +++ /dev/null @@ -1,16 +0,0 @@ -from aws_lambda_powertools import Logger -from aws_durable_execution_sdk_python import DurableContext, durable_execution - -logger = Logger(service="order-processing") - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - logger.info("Starting workflow") - - result: str = context.step( - lambda _: "processed", - name="process_data", - ) - - logger.info("Workflow completed", extra={"result": result}) - return result diff --git a/examples/python/core/logger/use-powertools-production.py b/examples/python/core/logger/use-powertools-production.py deleted file mode 100644 index 3ec60f7..0000000 --- a/examples/python/core/logger/use-powertools-production.py +++ /dev/null @@ -1,9 +0,0 @@ -from aws_lambda_powertools import Logger - -logger = Logger(service="my-service") - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - context.set_logger(logger) - # Now you get JSON logs with all Powertools for AWS Lambda (Python) features - context.logger.info("Processing started") diff --git a/examples/python/core/map/access-individual-results.py b/examples/python/core/map/access-individual-results.py deleted file mode 100644 index 0386a43..0000000 --- a/examples/python/core/map/access-individual-results.py +++ /dev/null @@ -1,3 +0,0 @@ -batch_result = context.map(items, process_item) -for item_result in batch_result.results: - print(item_result.result) diff --git a/examples/python/core/map/check-inventory.py b/examples/python/core/map/check-inventory.py deleted file mode 100644 index 0899e83..0000000 --- a/examples/python/core/map/check-inventory.py +++ /dev/null @@ -1,25 +0,0 @@ -def check_inventory( - context: DurableContext, - product_id: str, - index: int, - products: list[str] -) -> dict: - """Check if a product is in stock.""" - # Check if product is in stock - return {"product_id": product_id, "in_stock": True, "quantity": 10} - -@durable_execution -def handler(event: dict, context: DurableContext) -> list[str]: - product_ids = ["prod_1", "prod_2", "prod_3", "prod_4"] - - # Get all inventory results - batch_result = context.map(product_ids, check_inventory) - - # Filter to only in-stock products - in_stock = [ - r.result["product_id"] - for r in batch_result.results - if r.result["in_stock"] - ] - - return in_stock diff --git a/examples/python/core/map/custom-completion-criteria.py b/examples/python/core/map/custom-completion-criteria.py deleted file mode 100644 index 1601531..0000000 --- a/examples/python/core/map/custom-completion-criteria.py +++ /dev/null @@ -1,27 +0,0 @@ -from aws_durable_execution_sdk_python.config import CompletionConfig, MapConfig - - -def process_item( - context: DurableContext, item: int, index: int, items: list[int] -) -> dict: - """Process an item that might fail.""" - # Processing that might fail - if item % 7 == 0: - raise ValueError(f"Item {item} failed") - return {"item": item, "processed": True} - - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - items = list(range(20)) - - # Succeed if at least 15 items succeed, fail after 5 failures - config = MapConfig( - completion_config=CompletionConfig( - min_successful=15, - tolerated_failure_count=5, - ) - ) - - result = context.map(items, process_item, config=config) - return result.to_dict() diff --git a/examples/python/core/map/fetch-data.py b/examples/python/core/map/fetch-data.py deleted file mode 100644 index ba68271..0000000 --- a/examples/python/core/map/fetch-data.py +++ /dev/null @@ -1,18 +0,0 @@ -from aws_durable_execution_sdk_python.config import MapConfig - - -def fetch_data(context: DurableContext, url: str, index: int, urls: list[str]) -> dict: - """Fetch data from a URL.""" - # Network call that might be rate-limited - return {"url": url, "data": "..."} - - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - urls = [f"https://example.com/api/{i}" for i in range(100)] - - # Process only 5 URLs at a time - config = MapConfig(max_concurrency=5) - - result = context.map(urls, fetch_data, config=config) - return result.to_dict() diff --git a/examples/python/core/map/fetch-user-data.py b/examples/python/core/map/fetch-user-data.py deleted file mode 100644 index 4985579..0000000 --- a/examples/python/core/map/fetch-user-data.py +++ /dev/null @@ -1,32 +0,0 @@ -from aws_durable_execution_sdk_python import durable_step, StepContext - -@durable_step -def fetch_user_data(step_context: StepContext, user_id: str) -> dict: - """Fetch user data from external service.""" - return {"user_id": user_id, "name": "Jane Doe", "email": "jane_doe@example.com"} - -@durable_step -def send_notification(step_context: StepContext, user: dict) -> dict: - """Send notification to user.""" - return {"sent": True, "email": user["email"]} - -def process_user( - context: DurableContext, - user_id: str, - index: int, - user_ids: list[str] -) -> dict: - """Process a user by fetching data and sending notification.""" - # Use steps within the map function - user = context.step(fetch_user_data(user_id)) - notification = context.step(send_notification(user)) - return {"user_id": user_id, "notification_sent": notification["sent"]} - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Process multiple users using context operations within map functions.""" - user_ids = ["user_1", "user_2", "user_3"] - - result = context.map(user_ids, process_user) - # Convert to dict for JSON serialization (BatchResult is not JSON serializable) - return result.to_dict() diff --git a/examples/python/core/map/handle-partial-failures.py b/examples/python/core/map/handle-partial-failures.py deleted file mode 100644 index 9e95e78..0000000 --- a/examples/python/core/map/handle-partial-failures.py +++ /dev/null @@ -1,3 +0,0 @@ -batch_result = context.map(items, process_item) -successful = [r for r in batch_result.results if r.status == "SUCCEEDED"] -failed = [r for r in batch_result.results if r.status == "FAILED"] diff --git a/examples/python/core/map/map-function-signature.py b/examples/python/core/map/map-function-signature.py deleted file mode 100644 index 0ad9087..0000000 --- a/examples/python/core/map/map-function-signature.py +++ /dev/null @@ -1,9 +0,0 @@ -def process_item( - context: DurableContext, - item: U, - index: int, - items: Sequence[U] -) -> T: - """Process a single item from the collection.""" - # Your processing logic here - return result diff --git a/examples/python/core/map/map-method-signature.py b/examples/python/core/map/map-method-signature.py deleted file mode 100644 index 8f06f11..0000000 --- a/examples/python/core/map/map-method-signature.py +++ /dev/null @@ -1,6 +0,0 @@ -def map( - inputs: Sequence[U], - func: Callable[[DurableContext, U, int, Sequence[U]], T], - name: str | None = None, - config: MapConfig | None = None, -) -> BatchResult[T] diff --git a/examples/python/core/map/process-item.py b/examples/python/core/map/process-item.py deleted file mode 100644 index b82ff14..0000000 --- a/examples/python/core/map/process-item.py +++ /dev/null @@ -1,26 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, - BatchResult, -) -from aws_durable_execution_sdk_python.config import ( - MapConfig, - CompletionConfig, -) - -def process_item(context: DurableContext, item: int, index: int, items: list[int]) -> dict: - """Process a single item.""" - return {"item": item, "squared": item * item} - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - items = list(range(100)) - - # Configure map operation - config = MapConfig( - max_concurrency=10, # Process 10 items at a time - completion_config=CompletionConfig.all_successful(), # Require all to succeed - ) - - result = context.map(items, process_item, name="process_numbers", config=config) - return result.to_dict() diff --git a/examples/python/core/map/square.py b/examples/python/core/map/square.py deleted file mode 100644 index fd1e205..0000000 --- a/examples/python/core/map/square.py +++ /dev/null @@ -1,18 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, - BatchResult, -) - -def square(context: DurableContext, item: int, index: int, items: list[int]) -> int: - """Square a number.""" - return item * item - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Process a list of items using map operations.""" - items = [1, 2, 3, 4, 5] - - result = context.map(items, square) - # Convert to dict for JSON serialization (BatchResult is not JSON serializable) - return result.to_dict() diff --git a/examples/python/core/map/test-basic-map.py b/examples/python/core/map/test-basic-map.py deleted file mode 100644 index 563ae1e..0000000 --- a/examples/python/core/map/test-basic-map.py +++ /dev/null @@ -1,26 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python_testing import InvocationStatus -from my_function import handler - -@pytest.mark.durable_execution( - handler=handler, - lambda_function_name="map_operations", -) -def test_map_operations(durable_runner): - """Test map operations.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - # Check overall status - assert result.status is InvocationStatus.SUCCEEDED - - # Check the BatchResult - batch_result = result.result - assert batch_result.total_count == 5 - assert batch_result.success_count == 5 - assert batch_result.failure_count == 0 - - # Check individual results - assert batch_result.results[0].result == 1 - assert batch_result.results[1].result == 4 - assert batch_result.results[2].result == 9 diff --git a/examples/python/core/map/test-error-handling.py b/examples/python/core/map/test-error-handling.py deleted file mode 100644 index 6d25d0e..0000000 --- a/examples/python/core/map/test-error-handling.py +++ /dev/null @@ -1,21 +0,0 @@ -@pytest.mark.durable_execution( - handler=handler_with_errors, - lambda_function_name="map_with_errors", -) -def test_map_error_handling(durable_runner): - """Test error handling in map operations.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - # Function should handle errors based on completion config - assert result.status is InvocationStatus.SUCCEEDED - - batch_result = result.result - - # Check that some items succeeded - successful = [r for r in batch_result.results if r.status == "SUCCEEDED"] - assert len(successful) > 0 - - # Check that some items failed - failed = [r for r in batch_result.results if r.status == "FAILED"] - assert len(failed) > 0 diff --git a/examples/python/core/map/test-inspect-items.py b/examples/python/core/map/test-inspect-items.py deleted file mode 100644 index 72b9b20..0000000 --- a/examples/python/core/map/test-inspect-items.py +++ /dev/null @@ -1,21 +0,0 @@ -from aws_durable_execution_sdk_python.lambda_service import OperationType - -@pytest.mark.durable_execution( - handler=handler, - lambda_function_name="map_operations", -) -def test_map_individual_items(durable_runner): - """Test individual item processing.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - # Get the map operation - map_op = result.get_map("square") - assert map_op is not None - - # Verify all items were processed - assert map_op.result.total_count == 5 - - # Check specific items - assert map_op.result.results[0].result == 1 - assert map_op.result.results[2].result == 9 diff --git a/examples/python/core/map/test-with-config.py b/examples/python/core/map/test-with-config.py deleted file mode 100644 index 45f1927..0000000 --- a/examples/python/core/map/test-with-config.py +++ /dev/null @@ -1,20 +0,0 @@ -from aws_durable_execution_sdk_python.config import MapConfig, CompletionConfig - -@pytest.mark.durable_execution( - handler=handler_with_config, - lambda_function_name="map_with_config", -) -def test_map_with_config(durable_runner): - """Test map operations with custom configuration.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=30) - - # Verify the map operation completed - assert result.status is InvocationStatus.SUCCEEDED - - # Get the map operation - map_op = result.get_map("process_items") - - # Verify configuration was applied - assert map_op is not None - assert map_op.result.total_count > 0 diff --git a/examples/python/core/map/validate-email.py b/examples/python/core/map/validate-email.py deleted file mode 100644 index 358f559..0000000 --- a/examples/python/core/map/validate-email.py +++ /dev/null @@ -1,20 +0,0 @@ -def validate_email( - context: DurableContext, - item: str, - index: int, - items: list[str] -) -> dict: - """Validate an email address.""" - is_valid = "@" in item and "." in item - return { - "email": item, - "valid": is_valid, - "position": index, - "total": len(items) - } - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - emails = ["jane_doe@example.com", "john_doe@example.org", "invalid"] - result = context.map(emails, validate_email) - return result.to_dict() diff --git a/examples/python/core/parallel/access-individual-results.py b/examples/python/core/parallel/access-individual-results.py deleted file mode 100644 index 9dfffbf..0000000 --- a/examples/python/core/parallel/access-individual-results.py +++ /dev/null @@ -1,34 +0,0 @@ -from aws_durable_execution_sdk_python import ( - BatchResult, - DurableContext, - durable_execution, -) - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Access individual results from parallel execution.""" - - def task_a(ctx: DurableContext) -> str: - return ctx.step(lambda _: "Result A") - - def task_b(ctx: DurableContext) -> str: - return ctx.step(lambda _: "Result B") - - def task_c(ctx: DurableContext) -> str: - return ctx.step(lambda _: "Result C") - - result: BatchResult[str] = context.parallel([task_a, task_b, task_c]) - - results = result.get_results() - - # Access results by index - first_result = results[0] # "Result A" - second_result = results[1] # "Result B" - third_result = results[2] # "Result C" - - return { - "first": first_result, - "second": second_result, - "third": third_result, - "all": results, - } diff --git a/examples/python/core/parallel/all-completed-strategy.py b/examples/python/core/parallel/all-completed-strategy.py deleted file mode 100644 index 26f27b5..0000000 --- a/examples/python/core/parallel/all-completed-strategy.py +++ /dev/null @@ -1,4 +0,0 @@ -config = ParallelConfig( - completion_config=CompletionConfig.all_completed() -) -# If completion criteria are met early, remaining branches are marked STARTED diff --git a/examples/python/core/parallel/all-successful-strategy.py b/examples/python/core/parallel/all-successful-strategy.py deleted file mode 100644 index 26ca6ec..0000000 --- a/examples/python/core/parallel/all-successful-strategy.py +++ /dev/null @@ -1,4 +0,0 @@ -config = ParallelConfig( - completion_config=CompletionConfig.all_successful() -) -# Stops executing new branches after first failure diff --git a/examples/python/core/parallel/basic-usage.py b/examples/python/core/parallel/basic-usage.py deleted file mode 100644 index 3e55a0b..0000000 --- a/examples/python/core/parallel/basic-usage.py +++ /dev/null @@ -1,19 +0,0 @@ -from aws_durable_execution_sdk_python import ( - BatchResult, - DurableContext, - durable_execution, -) - -@durable_execution -def handler(event: dict, context: DurableContext) -> list[str]: - """Execute three tasks in parallel.""" - # Define functions to execute in parallel - task1 = lambda ctx: ctx.step(lambda _: "Task 1 complete", name="task1") - task2 = lambda ctx: ctx.step(lambda _: "Task 2 complete", name="task2") - task3 = lambda ctx: ctx.step(lambda _: "Task 3 complete", name="task3") - - # Execute all tasks concurrently - result: BatchResult[str] = context.parallel([task1, task2, task3]) - - # Return successful results - return result.get_results() diff --git a/examples/python/core/parallel/check-failures.py b/examples/python/core/parallel/check-failures.py deleted file mode 100644 index a9e8889..0000000 --- a/examples/python/core/parallel/check-failures.py +++ /dev/null @@ -1,17 +0,0 @@ -from aws_durable_execution_sdk_python import BatchResult - -result: BatchResult = context.parallel(functions) - -if result.failure_count > 0: - # Some branches failed - return { - "status": "partial_failure", - "successful": result.get_results(), - "failed_count": result.failure_count, - } - -# All branches succeeded -return { - "status": "success", - "results": result.get_results(), -} diff --git a/examples/python/core/parallel/collect-results.py b/examples/python/core/parallel/collect-results.py deleted file mode 100644 index 27a591d..0000000 --- a/examples/python/core/parallel/collect-results.py +++ /dev/null @@ -1,34 +0,0 @@ -from aws_durable_execution_sdk_python import ( - BatchResult, - DurableContext, - durable_execution, -) - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Demonstrate result collection.""" - - functions = [ - lambda ctx: ctx.step(lambda _: f"Result {i}") - for i in range(5) - ] - - result: BatchResult[str] = context.parallel(functions) - - return { - # Successful results only - "successful": result.succeeded(), - - # Failed results (if any) - "failed": result.failed(), - - # Counts - "total_count": result.total_count, - "success_count": result.success_count, - "failure_count": result.failure_count, - "started_count": result.started_count, - - # Status information - "status": result.status.value, - "completion_reason": result.completion_reason.value, - } diff --git a/examples/python/core/parallel/completion-config.py b/examples/python/core/parallel/completion-config.py deleted file mode 100644 index b25fd08..0000000 --- a/examples/python/core/parallel/completion-config.py +++ /dev/null @@ -1,7 +0,0 @@ -# Require at least 3 successes, tolerate up to 2 failures -config = ParallelConfig( - completion_config=CompletionConfig( - min_successful=3, - tolerated_failure_count=2, - ) -) diff --git a/examples/python/core/parallel/concurrency-limits.py b/examples/python/core/parallel/concurrency-limits.py deleted file mode 100644 index ad520f7..0000000 --- a/examples/python/core/parallel/concurrency-limits.py +++ /dev/null @@ -1,6 +0,0 @@ -from aws_durable_execution_sdk_python import BatchResult -from aws_durable_execution_sdk_python.config import ParallelConfig - -# Process 100 items, but only 10 at a time -config = ParallelConfig(max_concurrency=10) -result: BatchResult = context.parallel(functions, config=config) diff --git a/examples/python/core/parallel/controlled-concurrency.py b/examples/python/core/parallel/controlled-concurrency.py deleted file mode 100644 index 0522da8..0000000 --- a/examples/python/core/parallel/controlled-concurrency.py +++ /dev/null @@ -1,30 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, -) -from aws_durable_execution_sdk_python.config import ParallelConfig - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Process many items with controlled concurrency.""" - items = event.get("items", []) - - # Create a function for each item - functions = [ - lambda ctx, item=item: ctx.step( - lambda _: f"Processed {item}", - name=f"process_{item}" - ) - for item in items - ] - - # Process at most 10 items concurrently - config = ParallelConfig(max_concurrency=10) - - result: BatchResult[str] = context.parallel(functions, config=config) - - return { - "processed": result.success_count, - "failed": result.failure_count, - "results": result.get_results(), - } diff --git a/examples/python/core/parallel/first-successful-pattern.py b/examples/python/core/parallel/first-successful-pattern.py deleted file mode 100644 index 76b2601..0000000 --- a/examples/python/core/parallel/first-successful-pattern.py +++ /dev/null @@ -1,37 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, -) -from aws_durable_execution_sdk_python.config import ( - CompletionConfig, - ParallelConfig, -) - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - """Try multiple data sources, use first successful.""" - - def try_primary_db(ctx: DurableContext) -> dict: - return ctx.step(lambda _: {"source": "primary", "data": "..."}) - - def try_secondary_db(ctx: DurableContext) -> dict: - return ctx.step(lambda _: {"source": "secondary", "data": "..."}) - - def try_cache(ctx: DurableContext) -> dict: - return ctx.step(lambda _: {"source": "cache", "data": "..."}) - - # Complete as soon as any source succeeds - config = ParallelConfig( - completion_config=CompletionConfig.first_successful() - ) - - result: BatchResult[dict] = context.parallel( - [try_primary_db, try_secondary_db, try_cache], - config=config, - ) - - results = result.get_results() - if results: - return results[0] - - return {"error": "All sources failed"} diff --git a/examples/python/core/parallel/first-successful-strategy.py b/examples/python/core/parallel/first-successful-strategy.py deleted file mode 100644 index 19eb635..0000000 --- a/examples/python/core/parallel/first-successful-strategy.py +++ /dev/null @@ -1,4 +0,0 @@ -config = ParallelConfig( - completion_config=CompletionConfig.first_successful() -) -# Ignores failures until at least one succeeds diff --git a/examples/python/core/parallel/handle-partial-results.py b/examples/python/core/parallel/handle-partial-results.py deleted file mode 100644 index a7a3c7d..0000000 --- a/examples/python/core/parallel/handle-partial-results.py +++ /dev/null @@ -1,3 +0,0 @@ -# If function at index 1 fails: -# Input: [func0, func1, func2] -# Result: [result0, result2] # result1 is missing, but order preserved diff --git a/examples/python/core/parallel/individual-branch-failures.py b/examples/python/core/parallel/individual-branch-failures.py deleted file mode 100644 index 6a9d29e..0000000 --- a/examples/python/core/parallel/individual-branch-failures.py +++ /dev/null @@ -1,33 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, -) -from aws_durable_execution_sdk_python.config import ( - CompletionConfig, - ParallelConfig, -) - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Handle individual branch failures.""" - - def successful_task(ctx: DurableContext) -> str: - return ctx.step(lambda _: "Success") - - def failing_task(ctx: DurableContext) -> str: - return ctx.step(lambda _: raise_error("Task failed")) - - functions = [successful_task, failing_task, successful_task] - - # Use all_completed to collect per-branch status; check started_count for early completion - config = ParallelConfig( - completion_config=CompletionConfig.all_completed() - ) - - result: BatchResult[str] = context.parallel(functions, config=config) - - return { - "successful": result.succeeded(), - "failed_count": result.failure_count, - "status": result.status.value, - } diff --git a/examples/python/core/parallel/max-concurrency.py b/examples/python/core/parallel/max-concurrency.py deleted file mode 100644 index d7d0b32..0000000 --- a/examples/python/core/parallel/max-concurrency.py +++ /dev/null @@ -1,2 +0,0 @@ -# Limit to 5 concurrent branches -config = ParallelConfig(max_concurrency=5) diff --git a/examples/python/core/parallel/nested-parallel.py b/examples/python/core/parallel/nested-parallel.py deleted file mode 100644 index 99c7f2a..0000000 --- a/examples/python/core/parallel/nested-parallel.py +++ /dev/null @@ -1,34 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, -) - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Nested parallel execution.""" - - def process_group_a(ctx: DurableContext) -> list: - # Inner parallel operation for group A - task1 = lambda c: c.step(lambda _: "group-a-item-1") - task2 = lambda c: c.step(lambda _: "group-a-item-2") - task3 = lambda c: c.step(lambda _: "group-a-item-3") - - inner_result = ctx.parallel([task1, task2, task3]) - return inner_result.get_results() - - def process_group_b(ctx: DurableContext) -> list: - # Inner parallel operation for group B - task1 = lambda c: c.step(lambda _: "group-b-item-1") - task2 = lambda c: c.step(lambda _: "group-b-item-2") - task3 = lambda c: c.step(lambda _: "group-b-item-3") - - inner_result = ctx.parallel([task1, task2, task3]) - return inner_result.get_results() - - # Outer parallel operation - result: BatchResult[list] = context.parallel([process_group_a, process_group_b]) - - return { - "groups_processed": result.success_count, - "results": result.get_results(), - } diff --git a/examples/python/core/parallel/parallel-config.py b/examples/python/core/parallel/parallel-config.py deleted file mode 100644 index 9eb54cf..0000000 --- a/examples/python/core/parallel/parallel-config.py +++ /dev/null @@ -1,33 +0,0 @@ -from aws_durable_execution_sdk_python import ( - BatchResult, - DurableContext, - durable_execution, -) -from aws_durable_execution_sdk_python.config import ( - CompletionConfig, - ParallelConfig, -) - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - """Configure parallel execution.""" - - # Configure to complete when first branch succeeds - config = ParallelConfig( - max_concurrency=3, # Run at most 3 branches concurrently - completion_config=CompletionConfig.first_successful(), - ) - - functions = [ - lambda ctx: ctx.step(lambda _: "Task 1", name="task1"), - lambda ctx: ctx.step(lambda _: "Task 2", name="task2"), - lambda ctx: ctx.step(lambda _: "Task 3", name="task3"), - ] - - result: BatchResult[str] = context.parallel(functions, config=config) - - # Get the first successful result - results = result.succeeded() - first_result = results[0] if results else "None" - - return f"First successful result: {first_result}" diff --git a/examples/python/core/parallel/parallel-method-signature.py b/examples/python/core/parallel/parallel-method-signature.py deleted file mode 100644 index e7f0e18..0000000 --- a/examples/python/core/parallel/parallel-method-signature.py +++ /dev/null @@ -1,5 +0,0 @@ -def parallel( - functions: Sequence[Callable[[DurableContext], T]], - name: str | None = None, - config: ParallelConfig | None = None, -) -> BatchResult[T] diff --git a/examples/python/core/parallel/partial-success-handling.py b/examples/python/core/parallel/partial-success-handling.py deleted file mode 100644 index 6c3bda0..0000000 --- a/examples/python/core/parallel/partial-success-handling.py +++ /dev/null @@ -1,34 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, -) -from aws_durable_execution_sdk_python.config import ( - CompletionConfig, - ParallelConfig, -) - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Allow some branches to fail.""" - - # Require at least 2 successes, tolerate up to 1 failure - config = ParallelConfig( - completion_config=CompletionConfig( - min_successful=2, - tolerated_failure_count=1, - ) - ) - - functions = [ - lambda ctx: ctx.step(lambda _: "Success 1"), - lambda ctx: ctx.step(lambda _: "Success 2"), - lambda ctx: ctx.step(lambda _: raise_error()), # This might fail - ] - - result: BatchResult[str] = context.parallel(functions, config=config) - - return { - "status": "partial_success", - "successful": result.get_results(), - "failed_count": result.failure_count, - } diff --git a/examples/python/core/parallel/pass-different-arguments.py b/examples/python/core/parallel/pass-different-arguments.py deleted file mode 100644 index 75bfced..0000000 --- a/examples/python/core/parallel/pass-different-arguments.py +++ /dev/null @@ -1,4 +0,0 @@ -functions = [ - lambda ctx, val=value: process(ctx, val) - for value in values -] diff --git a/examples/python/core/parallel/result-ordering.py b/examples/python/core/parallel/result-ordering.py deleted file mode 100644 index a02d4a9..0000000 --- a/examples/python/core/parallel/result-ordering.py +++ /dev/null @@ -1,25 +0,0 @@ -from aws_durable_execution_sdk_python import ( - BatchResult, - DurableContext, - durable_execution, -) - -@durable_execution -def handler(event: dict, context: DurableContext) -> list[str]: - """Demonstrate result ordering.""" - - functions = [ - lambda ctx: ctx.step(lambda _: "First"), - lambda ctx: ctx.step(lambda _: "Second"), - lambda ctx: ctx.step(lambda _: "Third"), - ] - - result = context.parallel(functions) - - # Results are in the same order as functions - results = result.get_results() - assert results[0] == "First" - assert results[1] == "Second" - assert results[2] == "Third" - - return results diff --git a/examples/python/core/parallel/simple-parallel.py b/examples/python/core/parallel/simple-parallel.py deleted file mode 100644 index bc86fa2..0000000 --- a/examples/python/core/parallel/simple-parallel.py +++ /dev/null @@ -1,31 +0,0 @@ -from aws_durable_execution_sdk_python import ( - BatchResult, - DurableContext, - durable_execution, -) - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Process multiple services in parallel.""" - - def check_inventory(ctx: DurableContext) -> dict: - return ctx.step(lambda _: {"service": "inventory", "status": "ok"}) - - def check_payment(ctx: DurableContext) -> dict: - return ctx.step(lambda _: {"service": "payment", "status": "ok"}) - - def check_shipping(ctx: DurableContext) -> dict: - return ctx.step(lambda _: {"service": "shipping", "status": "ok"}) - - # Execute all checks in parallel - result: BatchResult[dict] = context.parallel([ - check_inventory, - check_payment, - check_shipping, - ]) - - return { - "total": result.total_count, - "successful": result.success_count, - "results": result.get_results(), - } diff --git a/examples/python/core/parallel/test-basic-parallel.py b/examples/python/core/parallel/test-basic-parallel.py deleted file mode 100644 index d4076d2..0000000 --- a/examples/python/core/parallel/test-basic-parallel.py +++ /dev/null @@ -1,19 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python_testing import InvocationStatus -from my_function import handler - -@pytest.mark.durable_execution( - handler=handler, - lambda_function_name="parallel_function", -) -def test_parallel(durable_runner): - """Test parallel operations.""" - with durable_runner: - result = durable_runner.run(input={"data": "test"}, timeout=10) - - # Check overall status - assert result.status is InvocationStatus.SUCCEEDED - - # Check the result contains expected values - assert len(result.result) == 3 - assert "Task 1 complete" in result.result diff --git a/examples/python/core/parallel/test-completion-strategies.py b/examples/python/core/parallel/test-completion-strategies.py deleted file mode 100644 index b76a53e..0000000 --- a/examples/python/core/parallel/test-completion-strategies.py +++ /dev/null @@ -1,12 +0,0 @@ -@pytest.mark.durable_execution( - handler=handler_first_successful, - lambda_function_name="first_successful_function", -) -def test_first_successful(durable_runner): - """Test first successful completion strategy.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - # Should succeed with at least one result - assert result.status is InvocationStatus.SUCCEEDED - assert "First successful result:" in result.result diff --git a/examples/python/core/parallel/test-concurrency-limits.py b/examples/python/core/parallel/test-concurrency-limits.py deleted file mode 100644 index ef558e5..0000000 --- a/examples/python/core/parallel/test-concurrency-limits.py +++ /dev/null @@ -1,12 +0,0 @@ -@pytest.mark.durable_execution( - handler=handler_with_concurrency_limit, - lambda_function_name="limited_concurrency", -) -def test_concurrency_limit(durable_runner): - """Test parallel operations with concurrency limit.""" - with durable_runner: - result = durable_runner.run(input={"items": list(range(20))}, timeout=30) - - # All items should be processed - assert result.status is InvocationStatus.SUCCEEDED - assert len(result.result["results"]) == 20 diff --git a/examples/python/core/parallel/test-error-handling.py b/examples/python/core/parallel/test-error-handling.py deleted file mode 100644 index c4915be..0000000 --- a/examples/python/core/parallel/test-error-handling.py +++ /dev/null @@ -1,13 +0,0 @@ -@pytest.mark.durable_execution( - handler=handler_with_failures, - lambda_function_name="parallel_with_failures", -) -def test_parallel_with_failures(durable_runner): - """Test parallel operations with some failures.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - # Check that some branches succeeded - assert result.status is InvocationStatus.SUCCEEDED - assert result.result["successful_count"] > 0 - assert result.result["failed_count"] > 0 diff --git a/examples/python/core/parallel/test-inspect-branches.py b/examples/python/core/parallel/test-inspect-branches.py deleted file mode 100644 index 5e4c34c..0000000 --- a/examples/python/core/parallel/test-inspect-branches.py +++ /dev/null @@ -1,21 +0,0 @@ -from aws_durable_execution_sdk_python_testing import OperationType - -@pytest.mark.durable_execution( - handler=handler, - lambda_function_name="parallel_function", -) -def test_parallel_branches(durable_runner): - """Test and inspect parallel branches.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - # Verify all step operations exist - step_ops = [ - op for op in result.operations - if op.operation_type == OperationType.STEP - ] - assert len(step_ops) == 3 - - # Check step names - step_names = {op.name for op in step_ops} - assert step_names == {"task1", "task2", "task3"} diff --git a/examples/python/core/steps/lambda-step-example.py b/examples/python/core/steps/lambda-step-example.py deleted file mode 100644 index c6e2734..0000000 --- a/examples/python/core/steps/lambda-step-example.py +++ /dev/null @@ -1,5 +0,0 @@ -# With @durable_step (recommended) -result = context.step(validate_order(order_id)) - -# Optionally, use a lambda function -result = context.step(lambda _: validate_order_logic(order_id)) diff --git a/examples/python/core/wait/appropriate-durations.py b/examples/python/core/wait/appropriate-durations.py deleted file mode 100644 index e392eca..0000000 --- a/examples/python/core/wait/appropriate-durations.py +++ /dev/null @@ -1,8 +0,0 @@ -# Short wait for rate limiting -context.wait(duration=Duration.from_seconds(30)) - -# Medium wait for polling intervals -context.wait(duration=Duration.from_minutes(5)) - -# Long wait for scheduled tasks -context.wait(duration=Duration.from_hours(24)) diff --git a/examples/python/core/wait/duration-from-seconds.py b/examples/python/core/wait/duration-from-seconds.py deleted file mode 100644 index b73befe..0000000 --- a/examples/python/core/wait/duration-from-seconds.py +++ /dev/null @@ -1,2 +0,0 @@ -# Wait for 300 seconds (5 minutes) -context.wait(duration=Duration(seconds=300)) diff --git a/examples/python/core/wait/minimum-wait-duration.py b/examples/python/core/wait/minimum-wait-duration.py deleted file mode 100644 index 5cc8920..0000000 --- a/examples/python/core/wait/minimum-wait-duration.py +++ /dev/null @@ -1,8 +0,0 @@ -# Avoid - too short, will raise ValidationError -context.wait(duration=Duration.from_seconds(0)) - -# Minimum - 1 second -context.wait(duration=Duration.from_seconds(1)) - -# Better - use meaningful durations -context.wait(duration=Duration.from_seconds(5)) diff --git a/examples/python/core/wait/multiple-named-waits.py b/examples/python/core/wait/multiple-named-waits.py deleted file mode 100644 index f89f2ed..0000000 --- a/examples/python/core/wait/multiple-named-waits.py +++ /dev/null @@ -1,7 +0,0 @@ -# Good - clear purpose -context.wait(duration=Duration.from_seconds(60), name="rate_limit_cooldown") -context.wait(duration=Duration.from_minutes(5), name="polling_interval") - -# Less clear - unnamed waits -context.wait(duration=Duration.from_seconds(60)) -context.wait(duration=Duration.from_minutes(5)) diff --git a/examples/python/core/wait/polling-with-condition.py b/examples/python/core/wait/polling-with-condition.py deleted file mode 100644 index d24063a..0000000 --- a/examples/python/core/wait/polling-with-condition.py +++ /dev/null @@ -1,27 +0,0 @@ -from aws_durable_execution_sdk_python.waits import WaitForConditionConfig, WaitForConditionDecision -from aws_durable_execution_sdk_python.config import Duration - - -def check_status(state, check_context): - status = get_job_status(state["job_id"]) - return {"job_id": state["job_id"], "status": status} - - -def wait_strategy(state, attempt): - if state["status"] == "completed": - return WaitForConditionDecision.stop_polling() - return WaitForConditionDecision.continue_waiting(Duration.from_minutes(1)) - - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - job_id = context.step(lambda ctx: start_job()) - - result = context.wait_for_condition( - check=check_status, - config=WaitForConditionConfig( - wait_strategy=wait_strategy, - initial_state={"job_id": job_id}, - ) - ) - return result diff --git a/examples/python/core/wait/wait-between-steps.py b/examples/python/core/wait/wait-between-steps.py deleted file mode 100644 index 45951a3..0000000 --- a/examples/python/core/wait/wait-between-steps.py +++ /dev/null @@ -1,12 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - # Start a process - job_id = context.step(start_job()) - - # Wait before checking status - context.wait(duration=Duration.from_seconds(30), name="initial_delay") - - # Check status - status = context.step(check_job_status(job_id)) - - return {"job_id": job_id, "status": status} diff --git a/examples/python/core/wait/wait-for-external-response.py b/examples/python/core/wait/wait-for-external-response.py deleted file mode 100644 index d0f0ba7..0000000 --- a/examples/python/core/wait/wait-for-external-response.py +++ /dev/null @@ -1,15 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution -from aws_durable_execution_sdk_python.context import WaitForCallbackContext - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - # Wait for external approval - def submit_for_approval(callback_id: str, ctx: WaitForCallbackContext): - # Send callback_id to external approval system - send_to_approval_system(callback_id) - - result = context.wait_for_callback( - submitter=submit_for_approval, - name="approval_wait" - ) - return result diff --git a/examples/python/getting-started/custom-boto3-client.py b/examples/python/getting-started/custom-boto3-client.py deleted file mode 100644 index d1ce2b9..0000000 --- a/examples/python/getting-started/custom-boto3-client.py +++ /dev/null @@ -1,18 +0,0 @@ -import boto3 -from botocore.config import Config -from aws_durable_execution_sdk_python import durable_execution, DurableContext - -# Create a custom boto3 Lambda client with specific configuration -custom_lambda_client = boto3.client( - 'lambda', - config=Config( - retries={'max_attempts': 5, 'mode': 'adaptive'}, - connect_timeout=10, - read_timeout=60, - ) -) - -@durable_execution(boto3_client=custom_lambda_client) -def handler(event: dict, context: DurableContext) -> dict: - # Your durable function logic - return {"status": "success"} diff --git a/examples/python/getting-started/test-locally.py b/examples/python/getting-started/test-locally.py deleted file mode 100644 index 1091586..0000000 --- a/examples/python/getting-started/test-locally.py +++ /dev/null @@ -1,9 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python.execution import InvocationStatus -from my_function import handler - -@pytest.mark.durable_execution(handler=handler, lambda_function_name="my_function") -def test_my_function(durable_runner): - with durable_runner: - result = durable_runner.run(input={"data": "test"}, timeout=10) - assert result.status == InvocationStatus.SUCCEEDED diff --git a/examples/python/getting-started/write-function.py b/examples/python/getting-started/write-function.py deleted file mode 100644 index 1ded10f..0000000 --- a/examples/python/getting-started/write-function.py +++ /dev/null @@ -1,18 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, - durable_step, - StepContext, -) - - -@durable_step -def my_step(step_context: StepContext, data: str) -> str: - # Your business logic here - return f"processed-{data}" - - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - result = context.step(my_step(event["data"])) - return result diff --git a/examples/python/index/quick-example.py b/examples/python/index/quick-example.py deleted file mode 100644 index 096c8c4..0000000 --- a/examples/python/index/quick-example.py +++ /dev/null @@ -1,52 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, - durable_step, -) -from aws_durable_execution_sdk_python.config import Duration - - -@durable_step -def validate_order(order_id: str) -> dict: - # Validation logic here - return {"order_id": order_id, "valid": True} - - -@durable_step -def charge_payment(order_id: str, amount: float) -> dict: - # Payment processing logic here - return {"transaction_id": "txn_123", "status": "completed"} - - -@durable_step -def fulfill_order(order_id: str) -> dict: - # Fulfillment logic here - return {"tracking_number": "TRK123456"} - - -@durable_execution -def process_order(event: dict, context: DurableContext) -> dict: - order_id = event["order_id"] - amount = event["amount"] - - # Step 1: Validate the order - validation = context.step(validate_order(order_id)) - - if not validation["valid"]: - return {"status": "failed", "reason": "invalid_order"} - - # Step 2: Charge payment - payment = context.step(charge_payment(order_id, amount)) - - # Step 3: Wait for payment confirmation (simulated) - context.wait(Duration.from_seconds(5)) - - # Step 4: Fulfill the order - fulfillment = context.step(fulfill_order(order_id)) - - return { - "status": "completed", - "order_id": order_id, - "transaction_id": payment["transaction_id"], - "tracking_number": fulfillment["tracking_number"], - } diff --git a/examples/python/operations/child-contexts/basic-child-context-testing.py b/examples/python/operations/child-contexts/basic-child-context-testing.py deleted file mode 100644 index 944f8ae..0000000 --- a/examples/python/operations/child-contexts/basic-child-context-testing.py +++ /dev/null @@ -1,16 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python_testing import InvocationStatus -from examples.src.run_in_child_context import run_in_child_context - -@pytest.mark.durable_execution( - handler=run_in_child_context.handler, - lambda_function_name="run in child context", -) -def test_run_in_child_context(durable_runner): - """Test basic child context execution.""" - with durable_runner: - result = durable_runner.run(input="test", timeout=10) - - # Check overall status - assert result.status is InvocationStatus.SUCCEEDED - assert result.result == "Child context result: 10" diff --git a/examples/python/operations/child-contexts/data-processing.py b/examples/python/operations/child-contexts/data-processing.py deleted file mode 100644 index 7907099..0000000 --- a/examples/python/operations/child-contexts/data-processing.py +++ /dev/null @@ -1,14 +0,0 @@ -@durable_with_child_context -def data_processing(ctx: DurableContext, data: dict) -> dict: - """Process data in a child context.""" - result = ctx.step(lambda _: transform_data(data), name="transform") - return result - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - # Named child context - result = context.run_in_child_context( - data_processing(event["data"]), - name="data_processor" - ) - return result diff --git a/examples/python/operations/child-contexts/decorator-example.py b/examples/python/operations/child-contexts/decorator-example.py deleted file mode 100644 index 6e69fdd..0000000 --- a/examples/python/operations/child-contexts/decorator-example.py +++ /dev/null @@ -1,4 +0,0 @@ -@durable_with_child_context -def my_context_function(ctx: DurableContext, arg1: str, arg2: int) -> dict: - # Your operations here - return result diff --git a/examples/python/operations/child-contexts/inspect-child-context-operations.py b/examples/python/operations/child-contexts/inspect-child-context-operations.py deleted file mode 100644 index 7b7e80b..0000000 --- a/examples/python/operations/child-contexts/inspect-child-context-operations.py +++ /dev/null @@ -1,19 +0,0 @@ -@pytest.mark.durable_execution( - handler=run_in_child_context.handler, - lambda_function_name="run in child context", -) -def test_child_context_operations(durable_runner): - """Test and inspect child context operations.""" - with durable_runner: - result = durable_runner.run(input="test", timeout=10) - - # Verify child context operation exists - context_ops = [ - op for op in result.operations - if op.operation_type.value == "CONTEXT" - ] - assert len(context_ops) >= 1 - - # Get child context by name (if named) - child_result = result.get_context("child_operation") - assert child_result is not None diff --git a/examples/python/operations/child-contexts/inventory-check.py b/examples/python/operations/child-contexts/inventory-check.py deleted file mode 100644 index 73f2eeb..0000000 --- a/examples/python/operations/child-contexts/inventory-check.py +++ /dev/null @@ -1,55 +0,0 @@ -@durable_with_child_context -def inventory_check(ctx: DurableContext, items: list) -> dict: - """Check inventory for all items.""" - results = [] - for item in items: - available = ctx.step( - lambda _: check_item_availability(item), - name=f"check_{item['id']}" - ) - results.append({"item_id": item["id"], "available": available}) - - return {"all_available": all(r["available"] for r in results)} - -@durable_with_child_context -def payment_processing(ctx: DurableContext, order_total: float) -> dict: - """Process payment in isolated context.""" - auth = ctx.step( - lambda _: authorize_payment(order_total), - name="authorize" - ) - - if auth["approved"]: - capture = ctx.step( - lambda _: capture_payment(auth["transaction_id"]), - name="capture" - ) - return {"status": "completed", "transaction_id": capture["id"]} - - return {"status": "declined"} - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Process order with organized child contexts.""" - # Check inventory - inventory = context.run_in_child_context( - inventory_check(event["items"]), - name="inventory_check" - ) - - if not inventory["all_available"]: - return {"status": "failed", "reason": "items_unavailable"} - - # Process payment - payment = context.run_in_child_context( - payment_processing(event["total"]), - name="payment_processing" - ) - - if payment["status"] != "completed": - return {"status": "failed", "reason": "payment_declined"} - - return { - "status": "success", - "transaction_id": payment["transaction_id"], - } diff --git a/examples/python/operations/child-contexts/process-order.py b/examples/python/operations/child-contexts/process-order.py deleted file mode 100644 index 783efd6..0000000 --- a/examples/python/operations/child-contexts/process-order.py +++ /dev/null @@ -1,48 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, - durable_with_child_context, -) - -@durable_with_child_context -def process_order(ctx: DurableContext, order_id: str, items: list) -> dict: - """Process an order in a child context.""" - # Validate items - validation = ctx.step( - lambda _: validate_items(items), - name="validate_items" - ) - - if not validation["valid"]: - return {"status": "invalid", "errors": validation["errors"]} - - # Calculate total - total = ctx.step( - lambda _: calculate_total(items), - name="calculate_total" - ) - - # Process payment - payment = ctx.step( - lambda _: process_payment(order_id, total), - name="process_payment" - ) - - return { - "order_id": order_id, - "total": total, - "payment_status": payment["status"], - } - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Process an order using a child context.""" - order_id = event["order_id"] - items = event["items"] - - # Execute order processing in child context - result = context.run_in_child_context( - process_order(order_id, items) - ) - - return result diff --git a/examples/python/operations/child-contexts/process-region-a.py b/examples/python/operations/child-contexts/process-region-a.py deleted file mode 100644 index 1af436a..0000000 --- a/examples/python/operations/child-contexts/process-region-a.py +++ /dev/null @@ -1,43 +0,0 @@ -@durable_with_child_context -def process_region_a(ctx: DurableContext, data: dict) -> dict: - """Process data for region A.""" - result = ctx.step(lambda _: process_for_region("A", data), name="process_a") - return {"region": "A", "result": result} - -@durable_with_child_context -def process_region_b(ctx: DurableContext, data: dict) -> dict: - """Process data for region B.""" - result = ctx.step(lambda _: process_for_region("B", data), name="process_b") - return {"region": "B", "result": result} - -@durable_with_child_context -def process_region_c(ctx: DurableContext, data: dict) -> dict: - """Process data for region C.""" - result = ctx.step(lambda _: process_for_region("C", data), name="process_c") - return {"region": "C", "result": result} - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Process data for multiple regions sequentially.""" - data = event["data"] - - # Execute child contexts sequentially - result_a = context.run_in_child_context( - process_region_a(data), - name="region_a" - ) - - result_b = context.run_in_child_context( - process_region_b(data), - name="region_b" - ) - - result_c = context.run_in_child_context( - process_region_c(data), - name="region_c" - ) - - return { - "regions_processed": 3, - "results": [result_a, result_b, result_c], - } diff --git a/examples/python/operations/child-contexts/risky-operation.py b/examples/python/operations/child-contexts/risky-operation.py deleted file mode 100644 index 31a3762..0000000 --- a/examples/python/operations/child-contexts/risky-operation.py +++ /dev/null @@ -1,30 +0,0 @@ -@durable_with_child_context -def risky_operation(ctx: DurableContext, data: dict) -> dict: - """Operation that might fail.""" - try: - result = ctx.step( - lambda _: potentially_failing_operation(data), - name="risky_step" - ) - return {"status": "success", "result": result} - except Exception as e: - # Handle error within child context - fallback = ctx.step( - lambda _: fallback_operation(data), - name="fallback" - ) - return {"status": "fallback", "result": fallback, "error": str(e)} - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Handle errors in child context.""" - result = context.run_in_child_context( - risky_operation(event["data"]), - name="risky_operation" - ) - - if result["status"] == "fallback": - # Log or handle fallback scenario - return {"warning": "Used fallback", "result": result["result"]} - - return result diff --git a/examples/python/operations/child-contexts/send-notifications.py b/examples/python/operations/child-contexts/send-notifications.py deleted file mode 100644 index 3b5e798..0000000 --- a/examples/python/operations/child-contexts/send-notifications.py +++ /dev/null @@ -1,49 +0,0 @@ -@durable_with_child_context -def send_notifications(ctx: DurableContext, user_id: str, message: str) -> dict: - """Send notifications through multiple channels.""" - email_sent = ctx.step( - lambda _: send_email(user_id, message), - name="send_email" - ) - - sms_sent = ctx.step( - lambda _: send_sms(user_id, message), - name="send_sms" - ) - - push_sent = ctx.step( - lambda _: send_push_notification(user_id, message), - name="send_push" - ) - - return { - "email": email_sent, - "sms": sms_sent, - "push": push_sent, - } - -@durable_execution -def order_confirmation_handler(event: dict, context: DurableContext) -> dict: - """Send order confirmation notifications.""" - notifications = context.run_in_child_context( - send_notifications( - event["user_id"], - f"Order {event['order_id']} confirmed" - ), - name="order_notifications" - ) - - return {"notifications_sent": notifications} - -@durable_execution -def shipment_handler(event: dict, context: DurableContext) -> dict: - """Send shipment notifications.""" - notifications = context.run_in_child_context( - send_notifications( - event["user_id"], - f"Order {event['order_id']} shipped" - ), - name="shipment_notifications" - ) - - return {"notifications_sent": notifications} diff --git a/examples/python/operations/child-contexts/standard-processing.py b/examples/python/operations/child-contexts/standard-processing.py deleted file mode 100644 index 205fdc5..0000000 --- a/examples/python/operations/child-contexts/standard-processing.py +++ /dev/null @@ -1,31 +0,0 @@ -@durable_with_child_context -def standard_processing(ctx: DurableContext, data: dict) -> dict: - """Standard data processing.""" - result = ctx.step(lambda _: process_standard(data), name="process") - return {"type": "standard", "result": result} - -@durable_with_child_context -def premium_processing(ctx: DurableContext, data: dict) -> dict: - """Premium data processing with extra steps.""" - enhanced = ctx.step(lambda _: enhance_data(data), name="enhance") - validated = ctx.step(lambda _: validate_premium(enhanced), name="validate") - result = ctx.step(lambda _: process_premium(validated), name="process") - return {"type": "premium", "result": result} - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Process data based on customer tier.""" - customer_tier = event.get("tier", "standard") - - if customer_tier == "premium": - result = context.run_in_child_context( - premium_processing(event["data"]), - name="premium_processing" - ) - else: - result = context.run_in_child_context( - standard_processing(event["data"]), - name="standard_processing" - ) - - return result diff --git a/examples/python/operations/child-contexts/test-error-handling.py b/examples/python/operations/child-contexts/test-error-handling.py deleted file mode 100644 index 4ac2992..0000000 --- a/examples/python/operations/child-contexts/test-error-handling.py +++ /dev/null @@ -1,13 +0,0 @@ -@pytest.mark.durable_execution( - handler=error_handling_handler, - lambda_function_name="error_handling", -) -def test_child_context_error_handling(durable_runner): - """Test error handling in child context.""" - with durable_runner: - result = durable_runner.run(input={"data": "invalid"}, timeout=10) - - # Function should handle error gracefully - assert result.status is InvocationStatus.SUCCEEDED - assert result.result["status"] == "fallback" - assert "error" in result.result diff --git a/examples/python/operations/child-contexts/test-large-data-handling.py b/examples/python/operations/child-contexts/test-large-data-handling.py deleted file mode 100644 index 57cf9f0..0000000 --- a/examples/python/operations/child-contexts/test-large-data-handling.py +++ /dev/null @@ -1,23 +0,0 @@ -from examples.src.run_in_child_context import run_in_child_context_large_data - -@pytest.mark.durable_execution( - handler=run_in_child_context_large_data.handler, - lambda_function_name="run in child context large data", -) -def test_large_data_processing(durable_runner): - """Test large data handling with child context.""" - with durable_runner: - result = durable_runner.run(input=None, timeout=30) - - result_data = result.result - - # Verify execution succeeded - assert result.status is InvocationStatus.SUCCEEDED - assert result_data["success"] is True - - # Verify large data was processed - assert result_data["summary"]["totalDataSize"] > 240 # ~250KB - assert result_data["summary"]["stepsExecuted"] == 5 - - # Verify data integrity across wait - assert result_data["dataIntegrityCheck"] is True diff --git a/examples/python/operations/child-contexts/validate-order.py b/examples/python/operations/child-contexts/validate-order.py deleted file mode 100644 index 00b7a94..0000000 --- a/examples/python/operations/child-contexts/validate-order.py +++ /dev/null @@ -1,55 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, - durable_step, - durable_with_child_context, - StepContext, -) - -@durable_step -def validate_order(step_context: StepContext, order_id: str) -> dict: - """Validate order details.""" - # Validation logic here - return {"valid": True, "order_id": order_id} - -@durable_step -def reserve_inventory(step_context: StepContext, order_id: str) -> dict: - """Reserve inventory for order.""" - # Inventory logic here - return {"reserved": True, "order_id": order_id} - -@durable_step -def charge_payment(step_context: StepContext, order_id: str) -> dict: - """Charge payment for order.""" - # Payment logic here - return {"charged": True, "order_id": order_id} - -@durable_step -def send_confirmation(step_context: StepContext, result: dict) -> dict: - """Send order confirmation.""" - # Notification logic here - return {"sent": True, "order_id": result["order_id"]} - -@durable_with_child_context -def process_order(ctx: DurableContext, order_id: str) -> dict: - """Process an order with multiple steps.""" - # These three steps execute as a single unit - validation = ctx.step(validate_order(order_id)) - inventory = ctx.step(reserve_inventory(order_id)) - payment = ctx.step(charge_payment(order_id)) - - return {"order_id": order_id, "status": "completed"} - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Process order using a child context.""" - # Once this completes, it never replays - even if the function continues - result = context.run_in_child_context( - process_order(event["order_id"]), - name="order_processing" - ) - - # Additional operations here won't cause process_order to replay - context.step(send_confirmation(result)) - - return result diff --git a/examples/python/sdk-reference/error-handling/base-exception.py b/examples/python/sdk-reference/error-handling/base-exception.py deleted file mode 100644 index c5f0fb8..0000000 --- a/examples/python/sdk-reference/error-handling/base-exception.py +++ /dev/null @@ -1,8 +0,0 @@ -from aws_durable_execution_sdk_python import DurableExecutionsError - -try: - # Your code here - pass -except DurableExecutionsError as e: - # Handle any SDK exception - print(f"SDK error: {e}") diff --git a/examples/python/sdk-reference/error-handling/callback-error.py b/examples/python/sdk-reference/error-handling/callback-error.py deleted file mode 100644 index 2aeced2..0000000 --- a/examples/python/sdk-reference/error-handling/callback-error.py +++ /dev/null @@ -1,17 +0,0 @@ -from aws_durable_execution_sdk_python.config import CallbackConfig -from aws_durable_execution_sdk_python.context import DurableContext -from aws_durable_execution_sdk_python.exceptions import CallbackError -from aws_durable_execution_sdk_python.execution import durable_execution - - -@durable_execution -def lambda_handler(event: dict, context: DurableContext) -> dict: - try: - callback = context.create_callback( - config=CallbackConfig(timeout_seconds=3600), - name="approval", - ) - context.wait_for_callback(callback) - return {"status": "approved"} - except CallbackError as e: - return {"error": "CallbackError", "callback_id": e.callback_id} diff --git a/examples/python/sdk-reference/error-handling/callback-timeout.py b/examples/python/sdk-reference/error-handling/callback-timeout.py deleted file mode 100644 index 5b0c4fa..0000000 --- a/examples/python/sdk-reference/error-handling/callback-timeout.py +++ /dev/null @@ -1,10 +0,0 @@ -from aws_durable_execution_sdk_python.config import CallbackConfig - -# Increase timeout -callback = context.create_callback( - config=CallbackConfig( - timeout_seconds=7200, # 2 hours - heartbeat_timeout_seconds=300, # 5 minutes - ), - name="long_running_approval" -) diff --git a/examples/python/sdk-reference/error-handling/checkpoint-failed.py b/examples/python/sdk-reference/error-handling/checkpoint-failed.py deleted file mode 100644 index 51de43d..0000000 --- a/examples/python/sdk-reference/error-handling/checkpoint-failed.py +++ /dev/null @@ -1,8 +0,0 @@ -# Reduce payload size by returning only necessary data -@durable_step -def large_operation(step_context: StepContext) -> dict: - # Process large data - large_result = process_data() - - # Return only summary, not full data - return {"summary": large_result["summary"], "count": len(large_result["items"])} diff --git a/examples/python/sdk-reference/error-handling/execution-error.py b/examples/python/sdk-reference/error-handling/execution-error.py deleted file mode 100644 index 0ea2017..0000000 --- a/examples/python/sdk-reference/error-handling/execution-error.py +++ /dev/null @@ -1,16 +0,0 @@ -from aws_durable_execution_sdk_python.context import DurableContext, StepContext, durable_step -from aws_durable_execution_sdk_python.exceptions import ExecutionError -from aws_durable_execution_sdk_python.execution import durable_execution - - -@durable_step -def process_data(step_context: StepContext, data: dict) -> dict: - if not data.get("required_field"): - raise ExecutionError("Required field missing") - return {"processed": True} - - -@durable_execution -def lambda_handler(event: dict, context: DurableContext) -> dict: - result = context.step(process_data(event)) - return result diff --git a/examples/python/sdk-reference/error-handling/faq-error-details.py b/examples/python/sdk-reference/error-handling/faq-error-details.py deleted file mode 100644 index 566552f..0000000 --- a/examples/python/sdk-reference/error-handling/faq-error-details.py +++ /dev/null @@ -1,6 +0,0 @@ -try: - result = context.step(operation()) -except CallbackError as e: - print(f"Callback failed: {e.callback_id}") -except NonDeterministicExecutionError as e: - print(f"Non-deterministic step: {e.step_id}") diff --git a/examples/python/sdk-reference/error-handling/faq-parallel-errors.py b/examples/python/sdk-reference/error-handling/faq-parallel-errors.py deleted file mode 100644 index 1270e40..0000000 --- a/examples/python/sdk-reference/error-handling/faq-parallel-errors.py +++ /dev/null @@ -1,7 +0,0 @@ -results = [] -for item in items: - try: - result = context.step(lambda _, i=item: process(i), name=f"process_{item}") - results.append(result) - except Exception as e: - results.append({"error": str(e)}) diff --git a/examples/python/sdk-reference/error-handling/faq-prevent-duplicates.py b/examples/python/sdk-reference/error-handling/faq-prevent-duplicates.py deleted file mode 100644 index bd673ce..0000000 --- a/examples/python/sdk-reference/error-handling/faq-prevent-duplicates.py +++ /dev/null @@ -1,5 +0,0 @@ -from aws_durable_execution_sdk_python.config import StepConfig, StepSemantics - -step_config = StepConfig( - step_semantics=StepSemantics.AT_MOST_ONCE_PER_RETRY -) diff --git a/examples/python/sdk-reference/error-handling/faq-retry-specific.py b/examples/python/sdk-reference/error-handling/faq-retry-specific.py deleted file mode 100644 index 9c79417..0000000 --- a/examples/python/sdk-reference/error-handling/faq-retry-specific.py +++ /dev/null @@ -1,4 +0,0 @@ -retry_config = RetryStrategyConfig( - max_attempts=3, - retryable_error_types=[ConnectionError, TimeoutError], -) diff --git a/examples/python/sdk-reference/error-handling/input-validation.py b/examples/python/sdk-reference/error-handling/input-validation.py deleted file mode 100644 index 348cd17..0000000 --- a/examples/python/sdk-reference/error-handling/input-validation.py +++ /dev/null @@ -1,25 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, -) - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Validate input and handle errors.""" - # Validate required fields - if not event.get("user_id"): - return {"error": "InvalidInput", "message": "user_id is required"} - - if not event.get("action"): - return {"error": "InvalidInput", "message": "action is required"} - - # Process valid input - user_id = event["user_id"] - action = event["action"] - - result = context.step( - lambda _: {"user_id": user_id, "action": action, "status": "completed"}, - name="process_action" - ) - - return result diff --git a/examples/python/sdk-reference/error-handling/invocation-error.py b/examples/python/sdk-reference/error-handling/invocation-error.py deleted file mode 100644 index 0fc1a49..0000000 --- a/examples/python/sdk-reference/error-handling/invocation-error.py +++ /dev/null @@ -1,22 +0,0 @@ -from aws_durable_execution_sdk_python.context import DurableContext, StepContext, durable_step -from aws_durable_execution_sdk_python.exceptions import InvocationError -from aws_durable_execution_sdk_python.execution import durable_execution - - -@durable_step -def call_external_service(step_context: StepContext) -> dict: - try: - response = make_api_call() - return response - except ConnectionError: - raise InvocationError("Service unavailable") - - -@durable_execution -def lambda_handler(event: dict, context: DurableContext) -> dict: - result = context.step(call_external_service()) - return result - - -def make_api_call() -> dict: - return {"status": "ok"} diff --git a/examples/python/sdk-reference/error-handling/multiple-error-types.py b/examples/python/sdk-reference/error-handling/multiple-error-types.py deleted file mode 100644 index ef73c5c..0000000 --- a/examples/python/sdk-reference/error-handling/multiple-error-types.py +++ /dev/null @@ -1,33 +0,0 @@ -from aws_durable_execution_sdk_python.context import DurableContext, StepContext, durable_step -from aws_durable_execution_sdk_python.exceptions import ExecutionError, InvocationError -from aws_durable_execution_sdk_python.execution import durable_execution - - -@durable_step -def complex_operation(step_context: StepContext, data: dict) -> dict: - if not data: - raise ValueError("Data is required") - if data.get("amount", 0) < 0: - raise ExecutionError("Amount must be positive") - try: - result = call_external_service(data) - return result - except ConnectionError: - raise InvocationError("Service unavailable") - - -@durable_execution -def lambda_handler(event: dict, context: DurableContext) -> dict: - try: - result = context.step(complex_operation(event)) - return {"status": "success", "result": result} - except ValueError as e: - return {"status": "invalid", "error": str(e)} - except ExecutionError as e: - return {"status": "failed", "error": str(e)} - except InvocationError: - raise - - -def call_external_service(data: dict) -> dict: - return {"processed": True} diff --git a/examples/python/sdk-reference/error-handling/permanent-failures.py b/examples/python/sdk-reference/error-handling/permanent-failures.py deleted file mode 100644 index 4b5057f..0000000 --- a/examples/python/sdk-reference/error-handling/permanent-failures.py +++ /dev/null @@ -1,30 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, - durable_step, - ExecutionError, - StepContext, -) - -@durable_step -def process_payment(step_context: StepContext, amount: float, card: str) -> dict: - """Process payment with validation.""" - # Validate card - if not is_valid_card(card): - # Don't retry invalid cards - raise ExecutionError("Invalid card number") - - # Process payment - return {"transaction_id": "txn_123", "amount": amount} - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Handle payment with error handling.""" - try: - result = context.step( - process_payment(event["amount"], event["card"]) - ) - return {"status": "success", "transaction": result} - except ExecutionError as e: - # Permanent failure, don't retry - return {"status": "failed", "error": str(e)} diff --git a/examples/python/sdk-reference/error-handling/retries-exhausted.py b/examples/python/sdk-reference/error-handling/retries-exhausted.py deleted file mode 100644 index a01530b..0000000 --- a/examples/python/sdk-reference/error-handling/retries-exhausted.py +++ /dev/null @@ -1,5 +0,0 @@ -# Ensure you're retrying the right errors -retry_config = RetryStrategyConfig( - max_attempts=5, # Increase attempts - retryable_error_types=[ConnectionError, TimeoutError], # Add error types -) diff --git a/examples/python/sdk-reference/error-handling/retry-specific-exceptions.py b/examples/python/sdk-reference/error-handling/retry-specific-exceptions.py deleted file mode 100644 index bcea48d..0000000 --- a/examples/python/sdk-reference/error-handling/retry-specific-exceptions.py +++ /dev/null @@ -1,34 +0,0 @@ -from random import random -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, - durable_step, - StepContext, -) -from aws_durable_execution_sdk_python.config import StepConfig -from aws_durable_execution_sdk_python.retries import ( - RetryStrategyConfig, - create_retry_strategy, -) - -@durable_step -def call_api(step_context: StepContext) -> dict: - """Call external API that might fail.""" - if random() > 0.5: - raise ConnectionError("Network timeout") - return {"status": "success"} - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - # Only retry ConnectionError, not other exceptions - retry_config = RetryStrategyConfig( - max_attempts=3, - retryable_error_types=[ConnectionError], - ) - - result = context.step( - call_api(), - config=StepConfig(create_retry_strategy(retry_config)), - ) - - return result diff --git a/examples/python/sdk-reference/error-handling/retry-strategy-config.py b/examples/python/sdk-reference/error-handling/retry-strategy-config.py deleted file mode 100644 index 06dbfb1..0000000 --- a/examples/python/sdk-reference/error-handling/retry-strategy-config.py +++ /dev/null @@ -1,37 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, - durable_step, - StepContext, -) -from aws_durable_execution_sdk_python.config import StepConfig -from aws_durable_execution_sdk_python.retries import ( - RetryStrategyConfig, - create_retry_strategy, -) - -@durable_step -def unreliable_operation(step_context: StepContext) -> str: - """Operation that might fail.""" - # Your code here - return "success" - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - # Configure retry strategy - retry_config = RetryStrategyConfig( - max_attempts=3, - initial_delay_seconds=1, - max_delay_seconds=10, - backoff_rate=2.0, - retryable_error_types=[RuntimeError, ConnectionError], - ) - - # Create step config with retry - step_config = StepConfig( - retry_strategy=create_retry_strategy(retry_config) - ) - - # Execute with retry - result = context.step(unreliable_operation(), config=step_config) - return result diff --git a/examples/python/sdk-reference/error-handling/step-interrupted-error.py b/examples/python/sdk-reference/error-handling/step-interrupted-error.py deleted file mode 100644 index b07ca6c..0000000 --- a/examples/python/sdk-reference/error-handling/step-interrupted-error.py +++ /dev/null @@ -1,22 +0,0 @@ -from aws_durable_execution_sdk_python.config import StepConfig, StepSemantics -from aws_durable_execution_sdk_python.context import DurableContext, StepContext, durable_step -from aws_durable_execution_sdk_python.exceptions import StepInterruptedError -from aws_durable_execution_sdk_python.execution import durable_execution - - -@durable_step -def long_running_operation(step_context: StepContext) -> dict: - return {"result": "done"} - - -@durable_execution -def lambda_handler(event: dict, context: DurableContext) -> dict: - try: - result = context.step( - long_running_operation(), - config=StepConfig(step_semantics=StepSemantics.AT_MOST_ONCE_PER_RETRY), - ) - return result - except StepInterruptedError: - context.logger.warning("Step interrupted, will not retry") - raise diff --git a/examples/python/sdk-reference/error-handling/test-error-conditions.py b/examples/python/sdk-reference/error-handling/test-error-conditions.py deleted file mode 100644 index bbe0caa..0000000 --- a/examples/python/sdk-reference/error-handling/test-error-conditions.py +++ /dev/null @@ -1,13 +0,0 @@ -@pytest.mark.durable_execution( - handler=handler_with_validation, - lambda_function_name="validation_function", -) -def test_input_validation(durable_runner): - """Test input validation handling.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - # Function should return error response for invalid input - assert result.status is InvocationStatus.SUCCEEDED - assert "error" in result.result - assert result.result["error"] == "InvalidInput" diff --git a/examples/python/sdk-reference/error-handling/test-inspect-error-details.py b/examples/python/sdk-reference/error-handling/test-inspect-error-details.py deleted file mode 100644 index 24df297..0000000 --- a/examples/python/sdk-reference/error-handling/test-inspect-error-details.py +++ /dev/null @@ -1,14 +0,0 @@ -@pytest.mark.durable_execution( - handler=handler_with_error, - lambda_function_name="error_function", -) -def test_error_details(durable_runner): - """Test error details are captured.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - # Check error details - assert result.status is InvocationStatus.FAILED - assert result.error is not None - assert "error_type" in result.error - assert "message" in result.error diff --git a/examples/python/sdk-reference/error-handling/test-retry-behavior.py b/examples/python/sdk-reference/error-handling/test-retry-behavior.py deleted file mode 100644 index 76d43ac..0000000 --- a/examples/python/sdk-reference/error-handling/test-retry-behavior.py +++ /dev/null @@ -1,11 +0,0 @@ -@pytest.mark.durable_execution( - handler=handler_with_retry, - lambda_function_name="retry_function", -) -def test_retry_success(durable_runner): - """Test that retries eventually succeed.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=30) - - # Should succeed after retries - assert result.status is InvocationStatus.SUCCEEDED diff --git a/examples/python/sdk-reference/error-handling/test-retry-exhaustion.py b/examples/python/sdk-reference/error-handling/test-retry-exhaustion.py deleted file mode 100644 index a70beb7..0000000 --- a/examples/python/sdk-reference/error-handling/test-retry-exhaustion.py +++ /dev/null @@ -1,12 +0,0 @@ -@pytest.mark.durable_execution( - handler=handler_always_fails, - lambda_function_name="failing_function", -) -def test_retry_exhausted(durable_runner): - """Test that execution fails after exhausting retries.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=30) - - # Should fail after all retries - assert result.status is InvocationStatus.FAILED - assert "RuntimeError" in str(result.error) diff --git a/examples/python/sdk-reference/error-handling/test-sdk-validation.py b/examples/python/sdk-reference/error-handling/test-sdk-validation.py deleted file mode 100644 index a25fa1f..0000000 --- a/examples/python/sdk-reference/error-handling/test-sdk-validation.py +++ /dev/null @@ -1,12 +0,0 @@ -@pytest.mark.durable_execution( - handler=handler_with_invalid_config, - lambda_function_name="sdk_validation_function", -) -def test_sdk_validation_error(durable_runner): - """Test SDK validation error handling.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - # SDK should catch invalid configuration - assert result.status is InvocationStatus.FAILED - assert "ValidationError" in str(result.error) diff --git a/examples/python/sdk-reference/error-handling/test-successful-execution.py b/examples/python/sdk-reference/error-handling/test-successful-execution.py deleted file mode 100644 index 8931960..0000000 --- a/examples/python/sdk-reference/error-handling/test-successful-execution.py +++ /dev/null @@ -1,14 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python_testing import InvocationStatus -from my_function import handler - -@pytest.mark.durable_execution( - handler=handler, - lambda_function_name="my_function", -) -def test_success(durable_runner): - """Test successful execution.""" - with durable_runner: - result = durable_runner.run(input={"data": "test"}, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED diff --git a/examples/python/sdk-reference/error-handling/transient-failures.py b/examples/python/sdk-reference/error-handling/transient-failures.py deleted file mode 100644 index e28f2b7..0000000 --- a/examples/python/sdk-reference/error-handling/transient-failures.py +++ /dev/null @@ -1,31 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, - durable_step, - StepContext, -) -from aws_durable_execution_sdk_python.config import StepConfig -from aws_durable_execution_sdk_python.retries import RetryPresets - -@durable_step -def call_external_api(step_context: StepContext, endpoint: str) -> dict: - """Call external API with retry.""" - # API call that might fail transiently - response = make_http_request(endpoint) - return response - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - """Handle API calls with automatic retry.""" - # Use transient preset for quick retries - step_config = StepConfig(retry_strategy=RetryPresets.transient()) - - try: - result = context.step( - call_external_api(event["endpoint"]), - config=step_config, - ) - return {"status": "success", "data": result} - except Exception as e: - # All retries exhausted - return {"status": "failed", "error": str(e)} diff --git a/examples/python/sdk-reference/error-handling/unrecoverable-error.py b/examples/python/sdk-reference/error-handling/unrecoverable-error.py deleted file mode 100644 index f0c6b7b..0000000 --- a/examples/python/sdk-reference/error-handling/unrecoverable-error.py +++ /dev/null @@ -1,8 +0,0 @@ -from aws_durable_execution_sdk_python.exceptions import ExecutionError, InvocationError - -try: - # Your code here - pass -except (ExecutionError, InvocationError) as e: - # Access termination reason from unrecoverable errors - print(f"Execution terminated: {e.termination_reason}") diff --git a/examples/python/sdk-reference/error-handling/unreliable-operation.py b/examples/python/sdk-reference/error-handling/unreliable-operation.py deleted file mode 100644 index 561e264..0000000 --- a/examples/python/sdk-reference/error-handling/unreliable-operation.py +++ /dev/null @@ -1,35 +0,0 @@ -from random import random - -from aws_durable_execution_sdk_python import ( - DurableContext, - StepContext, - durable_execution, - durable_step, -) -from aws_durable_execution_sdk_python.config import StepConfig -from aws_durable_execution_sdk_python.retries import ( - RetryStrategyConfig, - create_retry_strategy, -) - - -@durable_step -def unreliable_operation(step_context: StepContext) -> str: - if random() > 0.5: - raise RuntimeError("Random error occurred") - return "Operation succeeded" - - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - retry_config = RetryStrategyConfig( - max_attempts=3, - retryable_error_types=[RuntimeError], - ) - - result = context.step( - unreliable_operation(), - config=StepConfig(retry_strategy=create_retry_strategy(retry_config)), - ) - - return result diff --git a/examples/python/sdk-reference/serialization/pass-through-serdes.py b/examples/python/sdk-reference/serialization/pass-through-serdes.py deleted file mode 100644 index faaece6..0000000 --- a/examples/python/sdk-reference/serialization/pass-through-serdes.py +++ /dev/null @@ -1,22 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - StepContext, - durable_execution, - durable_step, -) -from aws_durable_execution_sdk_python.config import StepConfig -from aws_durable_execution_sdk_python.serdes import PassThroughSerDes - - -@durable_step -def fetch_raw(ctx: StepContext) -> str: - return '{"id":"order-123"}' - - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - raw = context.step( - fetch_raw(), - config=StepConfig(serdes=PassThroughSerDes()), - ) - return raw diff --git a/examples/python/testing-patterns/basic-tests/add-docstrings.py b/examples/python/testing-patterns/basic-tests/add-docstrings.py deleted file mode 100644 index 9150927..0000000 --- a/examples/python/testing-patterns/basic-tests/add-docstrings.py +++ /dev/null @@ -1,13 +0,0 @@ -@pytest.mark.durable_execution(handler=handler, lambda_function_name="payment") -def test_payment_with_retry(durable_runner): - """Test payment processing retries on transient failures. - - This test verifies that: - 1. Payment step retries on RuntimeError - 2. Function eventually succeeds after retries - 3. Final result includes transaction ID - """ - with durable_runner: - result = durable_runner.run(input={"amount": 50.0}, timeout=30) - - assert result.status is InvocationStatus.SUCCEEDED diff --git a/examples/python/testing-patterns/basic-tests/basic-step-testing.py b/examples/python/testing-patterns/basic-tests/basic-step-testing.py deleted file mode 100644 index b3ea2ed..0000000 --- a/examples/python/testing-patterns/basic-tests/basic-step-testing.py +++ /dev/null @@ -1,16 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python.execution import InvocationStatus - -from my_function import handler - - -@pytest.mark.durable_execution( - handler=handler, - lambda_function_name="my_function", -) -def test_step(durable_runner): - with durable_runner: - result = durable_runner.run(input={"data": "test"}, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED - assert result.result is not None diff --git a/examples/python/testing-patterns/basic-tests/callback-function.py b/examples/python/testing-patterns/basic-tests/callback-function.py deleted file mode 100644 index 3f202c9..0000000 --- a/examples/python/testing-patterns/basic-tests/callback-function.py +++ /dev/null @@ -1,16 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution -from aws_durable_execution_sdk_python.config import CallbackConfig - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - callback_config = CallbackConfig( - timeout_seconds=120, - heartbeat_timeout_seconds=60 - ) - - callback = context.create_callback( - name="example_callback", - config=callback_config - ) - - return f"Callback created with ID: {callback.callback_id}" diff --git a/examples/python/testing-patterns/basic-tests/check-expected-failures.py b/examples/python/testing-patterns/basic-tests/check-expected-failures.py deleted file mode 100644 index 1dfa81e..0000000 --- a/examples/python/testing-patterns/basic-tests/check-expected-failures.py +++ /dev/null @@ -1,11 +0,0 @@ -@pytest.mark.durable_execution( - handler=handler_with_validation, - lambda_function_name="validation_function", -) -def test_validation_failure(durable_runner): - """Test that invalid input causes failure.""" - with durable_runner: - result = durable_runner.run(input={"invalid": "data"}, timeout=10) - - assert result.status is InvocationStatus.FAILED - assert "ValidationError" in str(result.error) diff --git a/examples/python/testing-patterns/basic-tests/check-success.py b/examples/python/testing-patterns/basic-tests/check-success.py deleted file mode 100644 index 8a0d6a8..0000000 --- a/examples/python/testing-patterns/basic-tests/check-success.py +++ /dev/null @@ -1,10 +0,0 @@ -@pytest.mark.durable_execution( - handler=my_handler, - lambda_function_name="my_function", -) -def test_success(durable_runner): - """Test successful execution.""" - with durable_runner: - result = durable_runner.run(input={"data": "test"}, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED diff --git a/examples/python/testing-patterns/basic-tests/check-timeout.py b/examples/python/testing-patterns/basic-tests/check-timeout.py deleted file mode 100644 index 059df89..0000000 --- a/examples/python/testing-patterns/basic-tests/check-timeout.py +++ /dev/null @@ -1,11 +0,0 @@ -@pytest.mark.durable_execution( - handler=quick_handler, - lambda_function_name="quick_function", -) -def test_completes_quickly(durable_runner): - """Test that function completes within timeout.""" - with durable_runner: - # Use a short timeout to verify quick execution - result = durable_runner.run(input={}, timeout=5) - - assert result.status is InvocationStatus.SUCCEEDED diff --git a/examples/python/testing-patterns/basic-tests/child-context-function.py b/examples/python/testing-patterns/basic-tests/child-context-function.py deleted file mode 100644 index fbeac70..0000000 --- a/examples/python/testing-patterns/basic-tests/child-context-function.py +++ /dev/null @@ -1,14 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, - durable_with_child_context, -) - -@durable_with_child_context -def child_operation(ctx: DurableContext, value: int) -> int: - return ctx.step(lambda _: value * 2, name="multiply") - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - result = context.run_in_child_context(child_operation(5)) - return f"Child context result: {result}" diff --git a/examples/python/testing-patterns/basic-tests/conftest-setup.py b/examples/python/testing-patterns/basic-tests/conftest-setup.py deleted file mode 100644 index 839550f..0000000 --- a/examples/python/testing-patterns/basic-tests/conftest-setup.py +++ /dev/null @@ -1,14 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python_testing.runner import DurableFunctionTestRunner - -@pytest.fixture -def durable_runner(request): - """Pytest fixture that provides a test runner.""" - marker = request.node.get_closest_marker("durable_execution") - if not marker: - pytest.fail("Test must be marked with @pytest.mark.durable_execution") - - handler = marker.kwargs.get("handler") - runner = DurableFunctionTestRunner(handler=handler) - - yield runner diff --git a/examples/python/testing-patterns/basic-tests/descriptive-test-names.py b/examples/python/testing-patterns/basic-tests/descriptive-test-names.py deleted file mode 100644 index 88e884e..0000000 --- a/examples/python/testing-patterns/basic-tests/descriptive-test-names.py +++ /dev/null @@ -1,13 +0,0 @@ -# Good - describes what is being tested -def test_order_processing_succeeds_with_valid_input(durable_runner): - pass - -def test_order_processing_fails_with_invalid_order_id(durable_runner): - pass - -# Avoid - vague or unclear -def test_order(durable_runner): - pass - -def test_case_1(durable_runner): - pass diff --git a/examples/python/testing-patterns/basic-tests/group-related-tests.py b/examples/python/testing-patterns/basic-tests/group-related-tests.py deleted file mode 100644 index a96ffe0..0000000 --- a/examples/python/testing-patterns/basic-tests/group-related-tests.py +++ /dev/null @@ -1,21 +0,0 @@ -# tests/test_order_processing.py -class TestOrderValidation: - """Tests for order validation.""" - - @pytest.mark.durable_execution(handler=handler, lambda_function_name="orders") - def test_valid_order(self, durable_runner): - """Test valid order is accepted.""" - pass - - @pytest.mark.durable_execution(handler=handler, lambda_function_name="orders") - def test_invalid_order_id(self, durable_runner): - """Test invalid order ID is rejected.""" - pass - -class TestOrderFulfillment: - """Tests for order fulfillment.""" - - @pytest.mark.durable_execution(handler=handler, lambda_function_name="orders") - def test_fulfillment_success(self, durable_runner): - """Test successful order fulfillment.""" - pass diff --git a/examples/python/testing-patterns/basic-tests/inspect-step-results.py b/examples/python/testing-patterns/basic-tests/inspect-step-results.py deleted file mode 100644 index 87e87db..0000000 --- a/examples/python/testing-patterns/basic-tests/inspect-step-results.py +++ /dev/null @@ -1,16 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python.execution import InvocationStatus - -from my_function import handler - - -@pytest.mark.durable_execution( - handler=handler, - lambda_function_name="my_function", -) -def test_step_result(durable_runner): - with durable_runner: - result = durable_runner.run(input={"data": "test"}, timeout=10) - - step_result = result.get_step("add_numbers") - assert step_result.status is InvocationStatus.SUCCEEDED diff --git a/examples/python/testing-patterns/basic-tests/keep-tests-focused.py b/examples/python/testing-patterns/basic-tests/keep-tests-focused.py deleted file mode 100644 index 6da2d8a..0000000 --- a/examples/python/testing-patterns/basic-tests/keep-tests-focused.py +++ /dev/null @@ -1,28 +0,0 @@ -# Good - focused on one behavior -@pytest.mark.durable_execution(handler=handler, lambda_function_name="orders") -def test_order_validation_succeeds(durable_runner): - """Test order validation with valid input.""" - with durable_runner: - result = durable_runner.run(input={"order_id": "order-123"}, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED - -@pytest.mark.durable_execution(handler=handler, lambda_function_name="orders") -def test_order_validation_fails_missing_id(durable_runner): - """Test order validation fails without order ID.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - assert result.status is InvocationStatus.FAILED - -# Avoid - testing multiple behaviors -@pytest.mark.durable_execution(handler=handler, lambda_function_name="orders") -def test_order_validation(durable_runner): - """Test order validation.""" - # Test valid input - result1 = durable_runner.run(input={"order_id": "order-123"}, timeout=10) - assert result1.status is InvocationStatus.SUCCEEDED - - # Test invalid input - result2 = durable_runner.run(input={}, timeout=10) - assert result2.status is InvocationStatus.FAILED diff --git a/examples/python/testing-patterns/basic-tests/parallel-function.py b/examples/python/testing-patterns/basic-tests/parallel-function.py deleted file mode 100644 index 7daaf4b..0000000 --- a/examples/python/testing-patterns/basic-tests/parallel-function.py +++ /dev/null @@ -1,11 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution - -@durable_execution -def handler(event: dict, context: DurableContext) -> list[str]: - # Execute multiple operations - task1 = context.step(lambda _: "Task 1 complete", name="task1") - task2 = context.step(lambda _: "Task 2 complete", name="task2") - task3 = context.step(lambda _: "Task 3 complete", name="task3") - - # All tasks execute concurrently and results are collected - return [task1, task2, task3] diff --git a/examples/python/testing-patterns/basic-tests/parametrized-tests.py b/examples/python/testing-patterns/basic-tests/parametrized-tests.py deleted file mode 100644 index 63d3813..0000000 --- a/examples/python/testing-patterns/basic-tests/parametrized-tests.py +++ /dev/null @@ -1,14 +0,0 @@ -@pytest.mark.parametrize("a,b,expected", [ - (5, 3, 8), - (10, 20, 30), - (0, 0, 0), - (-5, 5, 0), -]) -@pytest.mark.durable_execution(handler=add_handler, lambda_function_name="calculator") -def test_addition(durable_runner, a, b, expected): - """Test addition with various inputs.""" - with durable_runner: - result = durable_runner.run(input={"a": a, "b": b}, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED - assert deserialize_operation_payload(result.result) == expected diff --git a/examples/python/testing-patterns/basic-tests/simple-function.py b/examples/python/testing-patterns/basic-tests/simple-function.py deleted file mode 100644 index be1ec97..0000000 --- a/examples/python/testing-patterns/basic-tests/simple-function.py +++ /dev/null @@ -1,6 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - """Simple hello world durable function.""" - return "Hello World!" diff --git a/examples/python/testing-patterns/basic-tests/simple-test.py b/examples/python/testing-patterns/basic-tests/simple-test.py deleted file mode 100644 index d754425..0000000 --- a/examples/python/testing-patterns/basic-tests/simple-test.py +++ /dev/null @@ -1,15 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python.execution import InvocationStatus -from test.conftest import deserialize_operation_payload - -@pytest.mark.durable_execution( - handler=handler, - lambda_function_name="hello world", -) -def test_hello_world(durable_runner): - """Test hello world example.""" - with durable_runner: - result = durable_runner.run(input="test", timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED - assert deserialize_operation_payload(result.result) == "Hello World!" diff --git a/examples/python/testing-patterns/basic-tests/step-function.py b/examples/python/testing-patterns/basic-tests/step-function.py deleted file mode 100644 index 7e7f6d0..0000000 --- a/examples/python/testing-patterns/basic-tests/step-function.py +++ /dev/null @@ -1,15 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, - durable_step, - StepContext, -) - -@durable_step -def add_numbers(step_context: StepContext, a: int, b: int) -> int: - return a + b - -@durable_execution -def handler(event: dict, context: DurableContext) -> int: - result = context.step(add_numbers(5, 3)) - return result diff --git a/examples/python/testing-patterns/basic-tests/test-error-handling.py b/examples/python/testing-patterns/basic-tests/test-error-handling.py deleted file mode 100644 index 4a69017..0000000 --- a/examples/python/testing-patterns/basic-tests/test-error-handling.py +++ /dev/null @@ -1,16 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python.execution import InvocationStatus - -from my_function import handler_with_error - - -@pytest.mark.durable_execution( - handler=handler_with_error, - lambda_function_name="error_function", -) -def test_step_error(durable_runner): - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - assert result.status is InvocationStatus.FAILED - assert result.error is not None diff --git a/examples/python/testing-patterns/basic-tests/test-retry-behavior.py b/examples/python/testing-patterns/basic-tests/test-retry-behavior.py deleted file mode 100644 index 3d67ebc..0000000 --- a/examples/python/testing-patterns/basic-tests/test-retry-behavior.py +++ /dev/null @@ -1,18 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python.execution import InvocationStatus - -from my_function import handler_with_retry - - -@pytest.mark.durable_execution( - handler=handler_with_retry, - lambda_function_name="retry_function", -) -def test_step_retry(durable_runner): - with durable_runner: - result = durable_runner.run(input={}, timeout=30) - - assert result.status is InvocationStatus.SUCCEEDED - - step_result = result.get_step("unreliable_operation") - assert step_result.status is InvocationStatus.SUCCEEDED diff --git a/examples/python/testing-patterns/basic-tests/test-wait-operation.py b/examples/python/testing-patterns/basic-tests/test-wait-operation.py deleted file mode 100644 index e3691e8..0000000 --- a/examples/python/testing-patterns/basic-tests/test-wait-operation.py +++ /dev/null @@ -1,22 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python.execution import InvocationStatus -from src.wait import wait - -@pytest.mark.durable_execution( - handler=wait.handler, - lambda_function_name="Wait State", -) -def test_wait(durable_runner): - """Test wait example.""" - with durable_runner: - result = durable_runner.run(input="test", timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED - - # Find the wait operation - wait_ops = [op for op in result.operations if op.operation_type.value == "WAIT"] - assert len(wait_ops) == 1 - - # Verify the wait has a scheduled end timestamp - wait_op = wait_ops[0] - assert wait_op.scheduled_end_timestamp is not None diff --git a/examples/python/testing-patterns/basic-tests/use-fixtures.py b/examples/python/testing-patterns/basic-tests/use-fixtures.py deleted file mode 100644 index 3f8fbe7..0000000 --- a/examples/python/testing-patterns/basic-tests/use-fixtures.py +++ /dev/null @@ -1,22 +0,0 @@ -# conftest.py -@pytest.fixture -def valid_order(): - """Provide valid order data.""" - return { - "order_id": "order-123", - "customer_id": "customer-456", - "amount": 100.0, - "items": [ - {"product_id": "prod-1", "quantity": 2}, - {"product_id": "prod-2", "quantity": 1}, - ], - } - -# test_orders.py -@pytest.mark.durable_execution(handler=handler, lambda_function_name="orders") -def test_order_processing(durable_runner, valid_order): - """Test order processing with valid data.""" - with durable_runner: - result = durable_runner.run(input=valid_order, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED diff --git a/examples/python/testing-patterns/basic-tests/verify-callback-operations.py b/examples/python/testing-patterns/basic-tests/verify-callback-operations.py deleted file mode 100644 index 5acccaa..0000000 --- a/examples/python/testing-patterns/basic-tests/verify-callback-operations.py +++ /dev/null @@ -1,21 +0,0 @@ -@pytest.mark.durable_execution( - handler=handler, - lambda_function_name="callback_function", -) -def test_callback_creation(durable_runner): - """Test callback is created correctly.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED - - # Find callback operations - callback_ops = [ - op for op in result.operations - if op.operation_type.value == "CALLBACK" - ] - assert len(callback_ops) == 1 - - callback_op = callback_ops[0] - assert callback_op.name == "example_callback" - assert callback_op.callback_id is not None diff --git a/examples/python/testing-patterns/basic-tests/verify-child-context.py b/examples/python/testing-patterns/basic-tests/verify-child-context.py deleted file mode 100644 index c52cb22..0000000 --- a/examples/python/testing-patterns/basic-tests/verify-child-context.py +++ /dev/null @@ -1,17 +0,0 @@ -@pytest.mark.durable_execution( - handler=handler, - lambda_function_name="child_context_function", -) -def test_child_context(durable_runner): - """Test child context executes.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED - - # Find child context operations - context_ops = [ - op for op in result.operations - if op.operation_type.value == "CONTEXT" - ] - assert len(context_ops) >= 1 diff --git a/examples/python/testing-patterns/basic-tests/verify-complex-values.py b/examples/python/testing-patterns/basic-tests/verify-complex-values.py deleted file mode 100644 index 7a87eca..0000000 --- a/examples/python/testing-patterns/basic-tests/verify-complex-values.py +++ /dev/null @@ -1,18 +0,0 @@ -@pytest.mark.durable_execution( - handler=order_handler, - lambda_function_name="order_processor", -) -def test_order_processing(durable_runner): - """Test order processing returns correct structure.""" - with durable_runner: - result = durable_runner.run( - input={"order_id": "order-123", "amount": 100.0}, - timeout=10 - ) - - assert result.status is InvocationStatus.SUCCEEDED - - order_result = deserialize_operation_payload(result.result) - assert order_result["order_id"] == "order-123" - assert order_result["status"] == "completed" - assert order_result["amount"] == 100.0 diff --git a/examples/python/testing-patterns/basic-tests/verify-list-results.py b/examples/python/testing-patterns/basic-tests/verify-list-results.py deleted file mode 100644 index fa519fc..0000000 --- a/examples/python/testing-patterns/basic-tests/verify-list-results.py +++ /dev/null @@ -1,18 +0,0 @@ -@pytest.mark.durable_execution( - handler=parallel_handler, - lambda_function_name="parallel_tasks", -) -def test_parallel_results(durable_runner): - """Test parallel operations return all results.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED - - results = deserialize_operation_payload(result.result) - assert len(results) == 3 - assert results == [ - "Task 1 complete", - "Task 2 complete", - "Task 3 complete", - ] diff --git a/examples/python/testing-patterns/basic-tests/verify-parallel-operations.py b/examples/python/testing-patterns/basic-tests/verify-parallel-operations.py deleted file mode 100644 index c0843aa..0000000 --- a/examples/python/testing-patterns/basic-tests/verify-parallel-operations.py +++ /dev/null @@ -1,23 +0,0 @@ -from aws_durable_execution_sdk_python.lambda_service import OperationType - -@pytest.mark.durable_execution( - handler=handler, - lambda_function_name="parallel_function", -) -def test_parallel_operations(durable_runner): - """Test parallel operations execute.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED - - # Find all step operations - step_ops = [ - op for op in result.operations - if op.operation_type == OperationType.STEP - ] - assert len(step_ops) == 3 - - # Verify step names - step_names = {op.name for op in step_ops} - assert step_names == {"task1", "task2", "task3"} diff --git a/examples/python/testing-patterns/basic-tests/verify-simple-values.py b/examples/python/testing-patterns/basic-tests/verify-simple-values.py deleted file mode 100644 index ffe370a..0000000 --- a/examples/python/testing-patterns/basic-tests/verify-simple-values.py +++ /dev/null @@ -1,13 +0,0 @@ -from test.conftest import deserialize_operation_payload - -@pytest.mark.durable_execution( - handler=calculator_handler, - lambda_function_name="calculator", -) -def test_calculation_result(durable_runner): - """Test calculation returns correct result.""" - with durable_runner: - result = durable_runner.run(input={"a": 5, "b": 3}, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED - assert deserialize_operation_payload(result.result) == 8 diff --git a/examples/python/testing-patterns/basic-tests/verify-step-operations.py b/examples/python/testing-patterns/basic-tests/verify-step-operations.py deleted file mode 100644 index 05baec1..0000000 --- a/examples/python/testing-patterns/basic-tests/verify-step-operations.py +++ /dev/null @@ -1,18 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python.execution import InvocationStatus -from test.conftest import deserialize_operation_payload - -@pytest.mark.durable_execution( - handler=handler, - lambda_function_name="step_function", -) -def test_step_execution(durable_runner): - """Test step executes correctly.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED - - # Get step by name - step_result = result.get_step("add_numbers") - assert deserialize_operation_payload(step_result.result) == 8 diff --git a/examples/python/testing-patterns/basic-tests/verify-wait-operations.py b/examples/python/testing-patterns/basic-tests/verify-wait-operations.py deleted file mode 100644 index 19c1135..0000000 --- a/examples/python/testing-patterns/basic-tests/verify-wait-operations.py +++ /dev/null @@ -1,18 +0,0 @@ -@pytest.mark.durable_execution( - handler=handler, - lambda_function_name="wait_function", -) -def test_wait_operation(durable_runner): - """Test wait operation is created.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED - - # Find wait operations - wait_ops = [ - op for op in result.operations - if op.operation_type.value == "WAIT" - ] - assert len(wait_ops) == 1 - assert wait_ops[0].scheduled_end_timestamp is not None diff --git a/examples/python/testing-patterns/basic-tests/wait-function.py b/examples/python/testing-patterns/basic-tests/wait-function.py deleted file mode 100644 index 727a159..0000000 --- a/examples/python/testing-patterns/basic-tests/wait-function.py +++ /dev/null @@ -1,7 +0,0 @@ -from aws_durable_execution_sdk_python import DurableContext, durable_execution -from aws_durable_execution_sdk_python.config import Duration - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - context.wait(Duration.from_seconds(5)) - return "Wait completed" diff --git a/examples/python/testing-patterns/complex-workflows/basic-parallel-workflow.py b/examples/python/testing-patterns/complex-workflows/basic-parallel-workflow.py deleted file mode 100644 index 4925b23..0000000 --- a/examples/python/testing-patterns/complex-workflows/basic-parallel-workflow.py +++ /dev/null @@ -1,7 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> list[str]: - task1 = context.step(lambda _: "Task 1 complete", name="task1") - task2 = context.step(lambda _: "Task 2 complete", name="task2") - task3 = context.step(lambda _: "Task 3 complete", name="task3") - - return [task1, task2, task3] diff --git a/examples/python/testing-patterns/complex-workflows/callback-timeouts-workflow.py b/examples/python/testing-patterns/complex-workflows/callback-timeouts-workflow.py deleted file mode 100644 index 9d87ab4..0000000 --- a/examples/python/testing-patterns/complex-workflows/callback-timeouts-workflow.py +++ /dev/null @@ -1,7 +0,0 @@ -from aws_durable_execution_sdk_python.config import CallbackConfig - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - config = CallbackConfig(timeout_seconds=60, heartbeat_timeout_seconds=30) - callback = context.create_callback(name="approval_callback", config=config) - return f"Callback created: {callback.callback_id}" diff --git a/examples/python/testing-patterns/complex-workflows/conditional-branching-workflow.py b/examples/python/testing-patterns/complex-workflows/conditional-branching-workflow.py deleted file mode 100644 index 65f9e52..0000000 --- a/examples/python/testing-patterns/complex-workflows/conditional-branching-workflow.py +++ /dev/null @@ -1,14 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - amount = event.get("amount", 0) - - context.step(lambda _: amount, name="validate_amount") - - if amount > 1000: - context.step(lambda _: "Manager approval required", name="approval") - context.wait(Duration.from_seconds(10), name="approval_wait") - result = context.step(lambda _: "High-value order processed", name="process_high") - else: - result = context.step(lambda _: "Standard order processed", name="process_standard") - - return result diff --git a/examples/python/testing-patterns/complex-workflows/expected-failures-workflow.py b/examples/python/testing-patterns/complex-workflows/expected-failures-workflow.py deleted file mode 100644 index 5d43af5..0000000 --- a/examples/python/testing-patterns/complex-workflows/expected-failures-workflow.py +++ /dev/null @@ -1,11 +0,0 @@ -@durable_step -def validate_input(step_context: StepContext, value: int) -> int: - if value < 0: - raise ValueError("Value must be non-negative") - return value - -@durable_execution -def handler(event: dict, context: DurableContext) -> int: - value = event.get("value", 0) - validated = context.step(validate_input(value), name="validate") - return validated diff --git a/examples/python/testing-patterns/complex-workflows/long-waits-workflow.py b/examples/python/testing-patterns/complex-workflows/long-waits-workflow.py deleted file mode 100644 index 2b3d8ab..0000000 --- a/examples/python/testing-patterns/complex-workflows/long-waits-workflow.py +++ /dev/null @@ -1,6 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - context.step(lambda _: "Starting", name="start") - context.wait(Duration.from_seconds(3600), name="long_wait") # 1 hour - context.step(lambda _: "Continuing", name="continue") - return "Complete" diff --git a/examples/python/testing-patterns/complex-workflows/maximum-attempts-workflow.py b/examples/python/testing-patterns/complex-workflows/maximum-attempts-workflow.py deleted file mode 100644 index 306da6d..0000000 --- a/examples/python/testing-patterns/complex-workflows/maximum-attempts-workflow.py +++ /dev/null @@ -1,15 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - target = event.get("target", 10) - state = 0 - attempt = 0 - max_attempts = 5 - - while attempt < max_attempts and state < target: - attempt += 1 - state = context.step(lambda _, s=state: s + 1, name=f"attempt_{attempt}") - - if state < target: - context.wait(Duration.from_seconds(1), name=f"wait_{attempt}") - - return {"state": state, "attempts": attempt, "reached_target": state >= target} diff --git a/examples/python/testing-patterns/complex-workflows/multiple-child-contexts-workflow.py b/examples/python/testing-patterns/complex-workflows/multiple-child-contexts-workflow.py deleted file mode 100644 index 9be5e5f..0000000 --- a/examples/python/testing-patterns/complex-workflows/multiple-child-contexts-workflow.py +++ /dev/null @@ -1,16 +0,0 @@ -@durable_with_child_context -def validate_data(ctx: DurableContext, data: dict) -> dict: - return ctx.step(lambda _: {**data, "validated": True}, name="validate") - -@durable_with_child_context -def transform_data(ctx: DurableContext, data: dict) -> dict: - return ctx.step(lambda _: {**data, "transformed": True}, name="transform") - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - data = event["data"] - - validated = context.run_in_child_context(validate_data(data), name="validation") - transformed = context.run_in_child_context(transform_data(validated), name="transformation") - - return transformed diff --git a/examples/python/testing-patterns/complex-workflows/partial-failures-workflow.py b/examples/python/testing-patterns/complex-workflows/partial-failures-workflow.py deleted file mode 100644 index d0fdf52..0000000 --- a/examples/python/testing-patterns/complex-workflows/partial-failures-workflow.py +++ /dev/null @@ -1,9 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - context.step(lambda _: "Step 1 complete", name="step1") - context.step(lambda _: "Step 2 complete", name="step2") - context.step( - lambda _: (_ for _ in ()).throw(RuntimeError("Step 3 failed")), - name="step3" - ) - return "Should not reach here" diff --git a/examples/python/testing-patterns/complex-workflows/processing-collections-workflow.py b/examples/python/testing-patterns/complex-workflows/processing-collections-workflow.py deleted file mode 100644 index 339678c..0000000 --- a/examples/python/testing-patterns/complex-workflows/processing-collections-workflow.py +++ /dev/null @@ -1,10 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> list[int]: - numbers = event.get("numbers", [1, 2, 3, 4, 5]) - - results = [] - for i, num in enumerate(numbers): - result = context.step(lambda _, n=num: n * 2, name=f"square_{i}") - results.append(result) - - return results diff --git a/examples/python/testing-patterns/complex-workflows/retry-behavior-workflow.py b/examples/python/testing-patterns/complex-workflows/retry-behavior-workflow.py deleted file mode 100644 index 71274bd..0000000 --- a/examples/python/testing-patterns/complex-workflows/retry-behavior-workflow.py +++ /dev/null @@ -1,32 +0,0 @@ -from aws_durable_execution_sdk_python.config import StepConfig -from aws_durable_execution_sdk_python.retries import ( - RetryStrategyConfig, - create_retry_strategy, -) - -attempt_count = 0 - -@durable_step -def unreliable_operation(step_context: StepContext) -> str: - global attempt_count - attempt_count += 1 - - if attempt_count < 3: - raise RuntimeError("Transient error") - - return "Operation succeeded" - -@durable_execution -def handler(event: dict, context: DurableContext) -> str: - retry_config = RetryStrategyConfig( - max_attempts=5, - retryable_error_types=[RuntimeError], - ) - - result = context.step( - unreliable_operation(), - config=StepConfig(create_retry_strategy(retry_config)), - name="unreliable" - ) - - return result diff --git a/examples/python/testing-patterns/complex-workflows/sequential-workflow.py b/examples/python/testing-patterns/complex-workflows/sequential-workflow.py deleted file mode 100644 index 3b3b96e..0000000 --- a/examples/python/testing-patterns/complex-workflows/sequential-workflow.py +++ /dev/null @@ -1,28 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, - durable_step, - StepContext, -) - -@durable_step -def validate_order(step_context: StepContext, order_id: str) -> dict: - return {"order_id": order_id, "status": "validated"} - -@durable_step -def process_payment(step_context: StepContext, order: dict) -> dict: - return {**order, "payment_status": "completed"} - -@durable_step -def fulfill_order(step_context: StepContext, order: dict) -> dict: - return {**order, "fulfillment_status": "shipped"} - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - order_id = event["order_id"] - - validated = context.step(validate_order(order_id), name="validate") - paid = context.step(process_payment(validated), name="payment") - fulfilled = context.step(fulfill_order(paid), name="fulfillment") - - return fulfilled diff --git a/examples/python/testing-patterns/complex-workflows/single-child-context-workflow.py b/examples/python/testing-patterns/complex-workflows/single-child-context-workflow.py deleted file mode 100644 index 5800ea3..0000000 --- a/examples/python/testing-patterns/complex-workflows/single-child-context-workflow.py +++ /dev/null @@ -1,23 +0,0 @@ -from aws_durable_execution_sdk_python import ( - DurableContext, - durable_execution, - durable_with_child_context, -) - -@durable_with_child_context -def process_item(ctx: DurableContext, item_id: str) -> dict: - ctx.step(lambda _: f"Validating {item_id}", name="validate") - result = ctx.step( - lambda _: {"item_id": item_id, "status": "processed"}, - name="process" - ) - return result - -@durable_execution -def handler(event: dict, context: DurableContext) -> dict: - item_id = event["item_id"] - result = context.run_in_child_context( - process_item(item_id), - name="item_processing" - ) - return result diff --git a/examples/python/testing-patterns/complex-workflows/test-basic-parallel.py b/examples/python/testing-patterns/complex-workflows/test-basic-parallel.py deleted file mode 100644 index b8e98bb..0000000 --- a/examples/python/testing-patterns/complex-workflows/test-basic-parallel.py +++ /dev/null @@ -1,17 +0,0 @@ -@pytest.mark.durable_execution(handler=handler, lambda_function_name="parallel_ops") -def test_parallel_operations(durable_runner): - """Test parallel execution.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=30) - - assert result.status is InvocationStatus.SUCCEEDED - - results = deserialize_operation_payload(result.result) - assert len(results) == 3 - - # Verify all steps ran - step_ops = [op for op in result.operations if op.operation_type == OperationType.STEP] - assert len(step_ops) == 3 - - step_names = {op.name for op in step_ops} - assert step_names == {"task1", "task2", "task3"} diff --git a/examples/python/testing-patterns/complex-workflows/test-callback-timeouts.py b/examples/python/testing-patterns/complex-workflows/test-callback-timeouts.py deleted file mode 100644 index 22e6f07..0000000 --- a/examples/python/testing-patterns/complex-workflows/test-callback-timeouts.py +++ /dev/null @@ -1,11 +0,0 @@ -@pytest.mark.durable_execution(handler=handler, lambda_function_name="callback_timeout") -def test_callback_timeout(durable_runner): - """Test callback timeout configuration.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED - - callback_ops = [op for op in result.operations if op.operation_type.value == "CALLBACK"] - assert len(callback_ops) == 1 - assert callback_ops[0].name == "approval_callback" diff --git a/examples/python/testing-patterns/complex-workflows/test-conditional-branching.py b/examples/python/testing-patterns/complex-workflows/test-conditional-branching.py deleted file mode 100644 index 9c83c9d..0000000 --- a/examples/python/testing-patterns/complex-workflows/test-conditional-branching.py +++ /dev/null @@ -1,24 +0,0 @@ -@pytest.mark.durable_execution(handler=handler, lambda_function_name="conditional_workflow") -def test_high_value_path(durable_runner): - """Test high-value orders require approval.""" - with durable_runner: - result = durable_runner.run(input={"amount": 1500}, timeout=30) - - assert result.status is InvocationStatus.SUCCEEDED - assert deserialize_operation_payload(result.result) == "High-value order processed" - - # Verify approval step exists - approval_step = result.get_step("approval") - assert approval_step is not None - -@pytest.mark.durable_execution(handler=handler, lambda_function_name="conditional_workflow") -def test_standard_path(durable_runner): - """Test standard orders skip approval.""" - with durable_runner: - result = durable_runner.run(input={"amount": 500}, timeout=30) - - assert result.status is InvocationStatus.SUCCEEDED - - # Verify no approval step - step_names = [op.name for op in result.operations if op.operation_type == OperationType.STEP] - assert "approval" not in step_names diff --git a/examples/python/testing-patterns/complex-workflows/test-expected-failures.py b/examples/python/testing-patterns/complex-workflows/test-expected-failures.py deleted file mode 100644 index 25a42e6..0000000 --- a/examples/python/testing-patterns/complex-workflows/test-expected-failures.py +++ /dev/null @@ -1,8 +0,0 @@ -@pytest.mark.durable_execution(handler=handler, lambda_function_name="validation_workflow") -def test_validation_failure(durable_runner): - """Test validation fails with invalid input.""" - with durable_runner: - result = durable_runner.run(input={"value": -5}, timeout=30) - - assert result.status is InvocationStatus.FAILED - assert "Value must be non-negative" in str(result.error) diff --git a/examples/python/testing-patterns/complex-workflows/test-long-waits.py b/examples/python/testing-patterns/complex-workflows/test-long-waits.py deleted file mode 100644 index 55ed577..0000000 --- a/examples/python/testing-patterns/complex-workflows/test-long-waits.py +++ /dev/null @@ -1,12 +0,0 @@ -@pytest.mark.durable_execution(handler=handler, lambda_function_name="long_wait") -def test_long_wait(durable_runner): - """Test long wait configuration.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED - - # Verify wait exists - wait_ops = [op for op in result.operations if op.operation_type.value == "WAIT"] - assert len(wait_ops) == 1 - assert wait_ops[0].name == "long_wait" diff --git a/examples/python/testing-patterns/complex-workflows/test-maximum-attempts.py b/examples/python/testing-patterns/complex-workflows/test-maximum-attempts.py deleted file mode 100644 index 608068c..0000000 --- a/examples/python/testing-patterns/complex-workflows/test-maximum-attempts.py +++ /dev/null @@ -1,12 +0,0 @@ -@pytest.mark.durable_execution(handler=handler, lambda_function_name="max_attempts") -def test_max_attempts(durable_runner): - """Test polling stops at max attempts.""" - with durable_runner: - result = durable_runner.run(input={"target": 10}, timeout=30) - - assert result.status is InvocationStatus.SUCCEEDED - - final_result = deserialize_operation_payload(result.result) - assert final_result["attempts"] == 5 - assert final_result["state"] == 5 - assert final_result["reached_target"] is False diff --git a/examples/python/testing-patterns/complex-workflows/test-multiple-child-contexts.py b/examples/python/testing-patterns/complex-workflows/test-multiple-child-contexts.py deleted file mode 100644 index e951a16..0000000 --- a/examples/python/testing-patterns/complex-workflows/test-multiple-child-contexts.py +++ /dev/null @@ -1,15 +0,0 @@ -@pytest.mark.durable_execution(handler=handler, lambda_function_name="multiple_contexts") -def test_multiple_child_contexts(durable_runner): - """Test multiple child contexts.""" - with durable_runner: - result = durable_runner.run(input={"data": {"value": 42}}, timeout=30) - - assert result.status is InvocationStatus.SUCCEEDED - - final_result = deserialize_operation_payload(result.result) - assert final_result["validated"] is True - assert final_result["transformed"] is True - - # Verify both contexts ran - context_ops = [op for op in result.operations if op.operation_type.value == "CONTEXT"] - assert len(context_ops) == 2 diff --git a/examples/python/testing-patterns/complex-workflows/test-partial-failures.py b/examples/python/testing-patterns/complex-workflows/test-partial-failures.py deleted file mode 100644 index ae18101..0000000 --- a/examples/python/testing-patterns/complex-workflows/test-partial-failures.py +++ /dev/null @@ -1,16 +0,0 @@ -@pytest.mark.durable_execution(handler=handler, lambda_function_name="partial_failure") -def test_partial_failure(durable_runner): - """Test workflow fails after some steps succeed.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=30) - - assert result.status is InvocationStatus.FAILED - - # First two steps succeeded - step1 = result.get_step("step1") - assert deserialize_operation_payload(step1.result) == "Step 1 complete" - - step2 = result.get_step("step2") - assert deserialize_operation_payload(step2.result) == "Step 2 complete" - - assert "Step 3 failed" in str(result.error) diff --git a/examples/python/testing-patterns/complex-workflows/test-processing-collections.py b/examples/python/testing-patterns/complex-workflows/test-processing-collections.py deleted file mode 100644 index 18c4468..0000000 --- a/examples/python/testing-patterns/complex-workflows/test-processing-collections.py +++ /dev/null @@ -1,12 +0,0 @@ -@pytest.mark.durable_execution(handler=handler, lambda_function_name="parallel_collection") -def test_collection_processing(durable_runner): - """Test collection processing.""" - with durable_runner: - result = durable_runner.run(input={"numbers": [1, 2, 3, 4, 5]}, timeout=30) - - assert result.status is InvocationStatus.SUCCEEDED - assert deserialize_operation_payload(result.result) == [2, 4, 6, 8, 10] - - # Verify all steps ran - step_ops = [op for op in result.operations if op.operation_type == OperationType.STEP] - assert len(step_ops) == 5 diff --git a/examples/python/testing-patterns/complex-workflows/test-retry-behavior.py b/examples/python/testing-patterns/complex-workflows/test-retry-behavior.py deleted file mode 100644 index 4b7abd5..0000000 --- a/examples/python/testing-patterns/complex-workflows/test-retry-behavior.py +++ /dev/null @@ -1,12 +0,0 @@ -@pytest.mark.durable_execution(handler=handler, lambda_function_name="retry_workflow") -def test_retry_behavior(durable_runner): - """Test operation retries on failure.""" - global attempt_count - attempt_count = 0 - - with durable_runner: - result = durable_runner.run(input={}, timeout=60) - - assert result.status is InvocationStatus.SUCCEEDED - assert deserialize_operation_payload(result.result) == "Operation succeeded" - assert attempt_count >= 3 diff --git a/examples/python/testing-patterns/complex-workflows/test-sequential-operations.py b/examples/python/testing-patterns/complex-workflows/test-sequential-operations.py deleted file mode 100644 index b8ecd63..0000000 --- a/examples/python/testing-patterns/complex-workflows/test-sequential-operations.py +++ /dev/null @@ -1,26 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python.execution import InvocationStatus -from aws_durable_execution_sdk_python.lambda_service import OperationType -from test.conftest import deserialize_operation_payload - -@pytest.mark.durable_execution(handler=handler, lambda_function_name="order_workflow") -def test_order_workflow(durable_runner): - """Test order processing executes all steps.""" - with durable_runner: - result = durable_runner.run(input={"order_id": "order-123"}, timeout=30) - - assert result.status is InvocationStatus.SUCCEEDED - - # Check final result - final_result = deserialize_operation_payload(result.result) - assert final_result["order_id"] == "order-123" - assert final_result["payment_status"] == "completed" - assert final_result["fulfillment_status"] == "shipped" - - # Verify all three steps ran - step_ops = [op for op in result.operations if op.operation_type == OperationType.STEP] - assert len(step_ops) == 3 - - # Check step order - step_names = [op.name for op in step_ops] - assert step_names == ["validate", "payment", "fulfillment"] diff --git a/examples/python/testing-patterns/complex-workflows/test-single-child-context.py b/examples/python/testing-patterns/complex-workflows/test-single-child-context.py deleted file mode 100644 index 0b55f40..0000000 --- a/examples/python/testing-patterns/complex-workflows/test-single-child-context.py +++ /dev/null @@ -1,17 +0,0 @@ -@pytest.mark.durable_execution(handler=handler, lambda_function_name="child_context_workflow") -def test_child_context(durable_runner): - """Test child context execution.""" - with durable_runner: - result = durable_runner.run(input={"item_id": "item-123"}, timeout=30) - - assert result.status is InvocationStatus.SUCCEEDED - - # Check child context ran - context_ops = [op for op in result.operations if op.operation_type.value == "CONTEXT"] - assert len(context_ops) == 1 - assert context_ops[0].name == "item_processing" - - # Check child context result - child_result = result.get_context("item_processing") - child_data = deserialize_operation_payload(child_result.result) - assert child_data["item_id"] == "item-123" diff --git a/examples/python/testing-patterns/complex-workflows/test-wait-for-condition.py b/examples/python/testing-patterns/complex-workflows/test-wait-for-condition.py deleted file mode 100644 index d2b5622..0000000 --- a/examples/python/testing-patterns/complex-workflows/test-wait-for-condition.py +++ /dev/null @@ -1,16 +0,0 @@ -@pytest.mark.durable_execution(handler=handler, lambda_function_name="polling") -def test_polling(durable_runner): - """Test wait-for-condition pattern.""" - with durable_runner: - result = durable_runner.run(input={}, timeout=30) - - assert result.status is InvocationStatus.SUCCEEDED - assert deserialize_operation_payload(result.result) == 3 - - # Should have 3 increment steps - step_ops = [op for op in result.operations if op.operation_type == OperationType.STEP] - assert len(step_ops) == 3 - - # Should have 2 waits (before reaching state 3) - wait_ops = [op for op in result.operations if op.operation_type.value == "WAIT"] - assert len(wait_ops) == 2 diff --git a/examples/python/testing-patterns/complex-workflows/wait-for-condition-workflow.py b/examples/python/testing-patterns/complex-workflows/wait-for-condition-workflow.py deleted file mode 100644 index 67b135e..0000000 --- a/examples/python/testing-patterns/complex-workflows/wait-for-condition-workflow.py +++ /dev/null @@ -1,17 +0,0 @@ -@durable_execution -def handler(event: dict, context: DurableContext) -> int: - state = 0 - attempt = 0 - max_attempts = 5 - - while attempt < max_attempts: - attempt += 1 - - state = context.step(lambda _, s=state: s + 1, name=f"increment_{attempt}") - - if state >= 3: - break - - context.wait(Duration.from_seconds(1), name=f"wait_{attempt}") - - return state diff --git a/examples/python/testing-patterns/stores/filesystem-store.py b/examples/python/testing-patterns/stores/filesystem-store.py deleted file mode 100644 index 6c013a0..0000000 --- a/examples/python/testing-patterns/stores/filesystem-store.py +++ /dev/null @@ -1,14 +0,0 @@ -from aws_durable_execution_sdk_python_testing.runner import ( - DurableFunctionCloudTestRunner, - DurableFunctionCloudTestRunnerConfig, -) -from aws_durable_execution_sdk_python_testing.stores.base import StoreType - -config = DurableFunctionCloudTestRunnerConfig( - function_name="my-function", - region="us-west-2", - store_type=StoreType.FILESYSTEM, - store_path="./my-test-executions", -) - -runner = DurableFunctionCloudTestRunner(config=config) diff --git a/examples/python/testing-patterns/stores/in-memory-store.py b/examples/python/testing-patterns/stores/in-memory-store.py deleted file mode 100644 index 18644d6..0000000 --- a/examples/python/testing-patterns/stores/in-memory-store.py +++ /dev/null @@ -1,13 +0,0 @@ -import pytest -from aws_durable_execution_sdk_python.execution import InvocationStatus - -@pytest.mark.durable_execution( - handler=my_handler, - lambda_function_name="my_function", -) -def test_with_memory_store(durable_runner): - """Test uses in-memory store by default.""" - with durable_runner: - result = durable_runner.run(input={"data": "test"}, timeout=10) - - assert result.status is InvocationStatus.SUCCEEDED diff --git a/examples/python/testing-patterns/stores/programmatic-config.py b/examples/python/testing-patterns/stores/programmatic-config.py deleted file mode 100644 index f6eb9f9..0000000 --- a/examples/python/testing-patterns/stores/programmatic-config.py +++ /dev/null @@ -1,22 +0,0 @@ -from aws_durable_execution_sdk_python_testing.runner import ( - DurableFunctionCloudTestRunner, - DurableFunctionCloudTestRunnerConfig, -) -from aws_durable_execution_sdk_python_testing.stores.base import StoreType - -# In-memory store (default) -config = DurableFunctionCloudTestRunnerConfig( - function_name="my-function", - region="us-west-2", - store_type=StoreType.MEMORY, -) - -# Filesystem store -config = DurableFunctionCloudTestRunnerConfig( - function_name="my-function", - region="us-west-2", - store_type=StoreType.FILESYSTEM, - store_path="./my-executions", -) - -runner = DurableFunctionCloudTestRunner(config=config) diff --git a/examples/typescript/advanced/serialization/appropriate-types.ts b/examples/typescript/advanced/serialization/appropriate-types.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/appropriate-types.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/callback-config.ts b/examples/typescript/advanced/serialization/callback-config.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/callback-config.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/container-types.ts b/examples/typescript/advanced/serialization/container-types.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/container-types.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/convert-to-dicts.ts b/examples/typescript/advanced/serialization/convert-to-dicts.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/convert-to-dicts.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/custom-objects.ts b/examples/typescript/advanced/serialization/custom-objects.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/custom-objects.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/custom-serdes.ts b/examples/typescript/advanced/serialization/custom-serdes.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/custom-serdes.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/dataclasses.ts b/examples/typescript/advanced/serialization/dataclasses.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/dataclasses.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/datetime-timezone.ts b/examples/typescript/advanced/serialization/datetime-timezone.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/datetime-timezone.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/default-behavior.ts b/examples/typescript/advanced/serialization/default-behavior.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/default-behavior.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/encryption.ts b/examples/typescript/advanced/serialization/encryption.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/encryption.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/extended-types.ts b/examples/typescript/advanced/serialization/extended-types.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/extended-types.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/faq-binary-data.ts b/examples/typescript/advanced/serialization/faq-binary-data.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/faq-binary-data.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/faq-debug-issues.ts b/examples/typescript/advanced/serialization/faq-debug-issues.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/faq-debug-issues.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/faq-json-strings.ts b/examples/typescript/advanced/serialization/faq-json-strings.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/faq-json-strings.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/faq-pydantic-models.ts b/examples/typescript/advanced/serialization/faq-pydantic-models.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/faq-pydantic-models.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/faq-serialization-fails.ts b/examples/typescript/advanced/serialization/faq-serialization-fails.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/faq-serialization-fails.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/handle-errors-gracefully.ts b/examples/typescript/advanced/serialization/handle-errors-gracefully.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/handle-errors-gracefully.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/keep-data-small.ts b/examples/typescript/advanced/serialization/keep-data-small.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/keep-data-small.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/large-payload-errors.ts b/examples/typescript/advanced/serialization/large-payload-errors.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/large-payload-errors.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/map-parallel-config.ts b/examples/typescript/advanced/serialization/map-parallel-config.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/map-parallel-config.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/primitive-types.ts b/examples/typescript/advanced/serialization/primitive-types.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/primitive-types.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/pydantic-models.ts b/examples/typescript/advanced/serialization/pydantic-models.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/pydantic-models.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/serialization-failed-error.ts b/examples/typescript/advanced/serialization/serialization-failed-error.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/serialization-failed-error.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/step-config.ts b/examples/typescript/advanced/serialization/step-config.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/step-config.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/test-round-trips.ts b/examples/typescript/advanced/serialization/test-round-trips.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/test-round-trips.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/type-not-preserved.ts b/examples/typescript/advanced/serialization/type-not-preserved.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/type-not-preserved.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/unsupported-type-error.ts b/examples/typescript/advanced/serialization/unsupported-type-error.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/unsupported-type-error.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/use-custom-serdes.ts b/examples/typescript/advanced/serialization/use-custom-serdes.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/use-custom-serdes.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/serialization/use-default-serialization.ts b/examples/typescript/advanced/serialization/use-default-serialization.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/serialization/use-default-serialization.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/testing-modes/appropriate-timeouts.ts b/examples/typescript/advanced/testing-modes/appropriate-timeouts.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/testing-modes/appropriate-timeouts.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/testing-modes/basic-cloud-test.ts b/examples/typescript/advanced/testing-modes/basic-cloud-test.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/testing-modes/basic-cloud-test.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/testing-modes/custom-timeout.ts b/examples/typescript/advanced/testing-modes/custom-timeout.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/testing-modes/custom-timeout.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/testing-modes/durable-execution-decorator.ts b/examples/typescript/advanced/testing-modes/durable-execution-decorator.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/testing-modes/durable-execution-decorator.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/testing-modes/mode-agnostic-tests.ts b/examples/typescript/advanced/testing-modes/mode-agnostic-tests.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/testing-modes/mode-agnostic-tests.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/testing-modes/mode-specific-assertions.ts b/examples/typescript/advanced/testing-modes/mode-specific-assertions.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/testing-modes/mode-specific-assertions.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/testing-modes/test-markers.ts b/examples/typescript/advanced/testing-modes/test-markers.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/testing-modes/test-markers.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/advanced/testing-modes/timeout-error.ts b/examples/typescript/advanced/testing-modes/timeout-error.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/advanced/testing-modes/timeout-error.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/basic-callback-testing.ts b/examples/typescript/core/callbacks/basic-callback-testing.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/basic-callback-testing.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/basic-example.ts b/examples/typescript/core/callbacks/basic-example.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/basic-example.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/callback-config.ts b/examples/typescript/core/callbacks/callback-config.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/callback-config.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/callback-with-fallback.ts b/examples/typescript/core/callbacks/callback-with-fallback.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/callback-with-fallback.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/conditional-callback-handling.ts b/examples/typescript/core/callbacks/conditional-callback-handling.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/conditional-callback-handling.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/create-callback-signature.ts b/examples/typescript/core/callbacks/create-callback-signature.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/create-callback-signature.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/duration-helpers.ts b/examples/typescript/core/callbacks/duration-helpers.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/duration-helpers.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/get-callback-id.ts b/examples/typescript/core/callbacks/get-callback-id.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/get-callback-id.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/get-callback-result.ts b/examples/typescript/core/callbacks/get-callback-result.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/get-callback-result.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/human-approval-workflow.ts b/examples/typescript/core/callbacks/human-approval-workflow.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/human-approval-workflow.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/inspect-callback-operations.ts b/examples/typescript/core/callbacks/inspect-callback-operations.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/inspect-callback-operations.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/message-broker-durable-function.ts b/examples/typescript/core/callbacks/message-broker-durable-function.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/message-broker-durable-function.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/message-broker-notification-handler.ts b/examples/typescript/core/callbacks/message-broker-notification-handler.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/message-broker-notification-handler.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/multiple-callbacks.ts b/examples/typescript/core/callbacks/multiple-callbacks.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/multiple-callbacks.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/notify-failure.ts b/examples/typescript/core/callbacks/notify-failure.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/notify-failure.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/notify-success.ts b/examples/typescript/core/callbacks/notify-success.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/notify-success.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/payment-processing.ts b/examples/typescript/core/callbacks/payment-processing.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/payment-processing.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/send-heartbeat.ts b/examples/typescript/core/callbacks/send-heartbeat.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/send-heartbeat.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/test-callback-timeout.ts b/examples/typescript/core/callbacks/test-callback-timeout.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/test-callback-timeout.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/test-integration-workflow.ts b/examples/typescript/core/callbacks/test-integration-workflow.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/test-integration-workflow.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/third-party-api-integration.ts b/examples/typescript/core/callbacks/third-party-api-integration.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/third-party-api-integration.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/wait-for-external-system.ts b/examples/typescript/core/callbacks/wait-for-external-system.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/wait-for-external-system.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/wait-using-result.ts b/examples/typescript/core/callbacks/wait-using-result.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/wait-using-result.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/callbacks/wait-using-wait-for-callback.ts b/examples/typescript/core/callbacks/wait-using-wait-for-callback.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/callbacks/wait-using-wait-for-callback.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/handle-invocation-error.ts b/examples/typescript/core/invoke/handle-invocation-error.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/handle-invocation-error.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/handle-timeout-error.ts b/examples/typescript/core/invoke/handle-timeout-error.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/handle-timeout-error.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/invoke-method-signature.ts b/examples/typescript/core/invoke/invoke-method-signature.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/invoke-method-signature.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/invoke-ondemand-function.ts b/examples/typescript/core/invoke/invoke-ondemand-function.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/invoke-ondemand-function.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/invoke-service.ts b/examples/typescript/core/invoke/invoke-service.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/invoke-service.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/invoke-with-config.ts b/examples/typescript/core/invoke/invoke-with-config.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/invoke-with-config.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/orchestrate-workflow.ts b/examples/typescript/core/invoke/orchestrate-workflow.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/orchestrate-workflow.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/parent-workflow.ts b/examples/typescript/core/invoke/parent-workflow.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/parent-workflow.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/pass-context-between-invocations.ts b/examples/typescript/core/invoke/pass-context-between-invocations.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/pass-context-between-invocations.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/pass-result-between-invokes.ts b/examples/typescript/core/invoke/pass-result-between-invokes.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/pass-result-between-invokes.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/process-document.ts b/examples/typescript/core/invoke/process-document.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/process-document.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/process-order.ts b/examples/typescript/core/invoke/process-order.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/process-order.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/retry-example-10.ts b/examples/typescript/core/invoke/retry-example-10.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/retry-example-10.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/serialize.ts b/examples/typescript/core/invoke/serialize.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/serialize.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/set-timeout.ts b/examples/typescript/core/invoke/set-timeout.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/set-timeout.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/test-basic-invoke.ts b/examples/typescript/core/invoke/test-basic-invoke.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/test-basic-invoke.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/test-error-handling.ts b/examples/typescript/core/invoke/test-error-handling.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/test-error-handling.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/test-inspect-invoke.ts b/examples/typescript/core/invoke/test-inspect-invoke.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/test-inspect-invoke.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/test-mock-invoked-functions.ts b/examples/typescript/core/invoke/test-mock-invoked-functions.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/test-mock-invoked-functions.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/invoke/test-timeout-handling.ts b/examples/typescript/core/invoke/test-timeout-handling.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/invoke/test-timeout-handling.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/add-custom-metadata.ts b/examples/typescript/core/logger/add-custom-metadata.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/add-custom-metadata.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/automatic-context-enrichment.ts b/examples/typescript/core/logger/automatic-context-enrichment.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/automatic-context-enrichment.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/avoid-sensitive-data.ts b/examples/typescript/core/logger/avoid-sensitive-data.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/avoid-sensitive-data.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/basic-usage.ts b/examples/typescript/core/logger/basic-usage.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/basic-usage.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/child-workflow.ts b/examples/typescript/core/logger/child-workflow.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/child-workflow.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/context-logger-deduplication.ts b/examples/typescript/core/logger/context-logger-deduplication.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/context-logger-deduplication.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/direct-logger-duplicates.ts b/examples/typescript/core/logger/direct-logger-duplicates.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/direct-logger-duplicates.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/include-business-context.ts b/examples/typescript/core/logger/include-business-context.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/include-business-context.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/integrate-powertools-context.ts b/examples/typescript/core/logger/integrate-powertools-context.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/integrate-powertools-context.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/lambda-log-controls.ts b/examples/typescript/core/logger/lambda-log-controls.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/lambda-log-controls.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/logger-interface-protocol.ts b/examples/typescript/core/logger/logger-interface-protocol.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/logger-interface-protocol.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/logger-method-signature.ts b/examples/typescript/core/logger/logger-method-signature.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/logger-method-signature.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/powertools-with-deduplication.ts b/examples/typescript/core/logger/powertools-with-deduplication.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/powertools-with-deduplication.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/selective-logging.ts b/examples/typescript/core/logger/selective-logging.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/selective-logging.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/set-powertools-log-level.ts b/examples/typescript/core/logger/set-powertools-log-level.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/set-powertools-log-level.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/set-standard-log-level.ts b/examples/typescript/core/logger/set-standard-log-level.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/set-standard-log-level.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/silence-botocore.ts b/examples/typescript/core/logger/silence-botocore.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/silence-botocore.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/structured-logging-extra.ts b/examples/typescript/core/logger/structured-logging-extra.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/structured-logging-extra.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/test-basic-logger.ts b/examples/typescript/core/logger/test-basic-logger.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/test-basic-logger.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/test-verify-log-output.ts b/examples/typescript/core/logger/test-verify-log-output.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/test-verify-log-output.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/test-with-powertools.ts b/examples/typescript/core/logger/test-with-powertools.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/test-with-powertools.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/use-powertools-directly.ts b/examples/typescript/core/logger/use-powertools-directly.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/use-powertools-directly.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/logger/use-powertools-production.ts b/examples/typescript/core/logger/use-powertools-production.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/logger/use-powertools-production.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/map/access-individual-results.ts b/examples/typescript/core/map/access-individual-results.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/map/access-individual-results.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/map/check-inventory.ts b/examples/typescript/core/map/check-inventory.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/map/check-inventory.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/map/custom-completion-criteria.ts b/examples/typescript/core/map/custom-completion-criteria.ts deleted file mode 100644 index fa4da07..0000000 --- a/examples/typescript/core/map/custom-completion-criteria.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { MapConfig, CompletionConfig } from '@aws/durable-execution-sdk-js'; - -const items = Array.from({ length: 20 }, (_, i) => i); - -const results = await context.map( - 'process-items', - items, - async (ctx, item, index) => { - // Processing that might fail - if (item % 7 === 0) { - throw new Error(`Item ${item} failed`); - } - return { item, processed: true }; - }, - { - completionConfig: { - minSuccessful: 15, // Succeed if at least 15 items succeed - toleratedFailureCount: 5, // Fail after 5 failures - } - } -); - -return results.getResults(); diff --git a/examples/typescript/core/map/fetch-data.ts b/examples/typescript/core/map/fetch-data.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/map/fetch-data.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/map/fetch-user-data.ts b/examples/typescript/core/map/fetch-user-data.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/map/fetch-user-data.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/map/handle-partial-failures.ts b/examples/typescript/core/map/handle-partial-failures.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/map/handle-partial-failures.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/map/map-function-signature.ts b/examples/typescript/core/map/map-function-signature.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/map/map-function-signature.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/map/map-method-signature.ts b/examples/typescript/core/map/map-method-signature.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/map/map-method-signature.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/map/process-item.ts b/examples/typescript/core/map/process-item.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/map/process-item.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/map/square.ts b/examples/typescript/core/map/square.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/map/square.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/map/test-basic-map.ts b/examples/typescript/core/map/test-basic-map.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/map/test-basic-map.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/map/test-error-handling.ts b/examples/typescript/core/map/test-error-handling.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/map/test-error-handling.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/map/test-inspect-items.ts b/examples/typescript/core/map/test-inspect-items.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/map/test-inspect-items.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/map/test-with-config.ts b/examples/typescript/core/map/test-with-config.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/map/test-with-config.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/map/validate-email.ts b/examples/typescript/core/map/validate-email.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/map/validate-email.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/access-individual-results.ts b/examples/typescript/core/parallel/access-individual-results.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/access-individual-results.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/all-completed-strategy.ts b/examples/typescript/core/parallel/all-completed-strategy.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/all-completed-strategy.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/all-successful-strategy.ts b/examples/typescript/core/parallel/all-successful-strategy.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/all-successful-strategy.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/basic-usage.ts b/examples/typescript/core/parallel/basic-usage.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/basic-usage.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/check-failures.ts b/examples/typescript/core/parallel/check-failures.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/check-failures.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/collect-results.ts b/examples/typescript/core/parallel/collect-results.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/collect-results.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/completion-config.ts b/examples/typescript/core/parallel/completion-config.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/completion-config.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/concurrency-limits.ts b/examples/typescript/core/parallel/concurrency-limits.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/concurrency-limits.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/controlled-concurrency.ts b/examples/typescript/core/parallel/controlled-concurrency.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/controlled-concurrency.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/first-successful-pattern.ts b/examples/typescript/core/parallel/first-successful-pattern.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/first-successful-pattern.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/first-successful-strategy.ts b/examples/typescript/core/parallel/first-successful-strategy.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/first-successful-strategy.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/handle-partial-results.ts b/examples/typescript/core/parallel/handle-partial-results.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/handle-partial-results.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/individual-branch-failures.ts b/examples/typescript/core/parallel/individual-branch-failures.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/individual-branch-failures.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/max-concurrency.ts b/examples/typescript/core/parallel/max-concurrency.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/max-concurrency.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/nested-parallel.ts b/examples/typescript/core/parallel/nested-parallel.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/nested-parallel.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/parallel-config.ts b/examples/typescript/core/parallel/parallel-config.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/parallel-config.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/parallel-method-signature.ts b/examples/typescript/core/parallel/parallel-method-signature.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/parallel-method-signature.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/partial-success-handling.ts b/examples/typescript/core/parallel/partial-success-handling.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/partial-success-handling.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/pass-different-arguments.ts b/examples/typescript/core/parallel/pass-different-arguments.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/pass-different-arguments.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/result-ordering.ts b/examples/typescript/core/parallel/result-ordering.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/result-ordering.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/simple-parallel.ts b/examples/typescript/core/parallel/simple-parallel.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/simple-parallel.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/test-basic-parallel.ts b/examples/typescript/core/parallel/test-basic-parallel.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/test-basic-parallel.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/test-completion-strategies.ts b/examples/typescript/core/parallel/test-completion-strategies.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/test-completion-strategies.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/test-concurrency-limits.ts b/examples/typescript/core/parallel/test-concurrency-limits.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/test-concurrency-limits.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/test-error-handling.ts b/examples/typescript/core/parallel/test-error-handling.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/test-error-handling.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/parallel/test-inspect-branches.ts b/examples/typescript/core/parallel/test-inspect-branches.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/core/parallel/test-inspect-branches.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/core/steps/lambda-step-example.ts b/examples/typescript/core/steps/lambda-step-example.ts deleted file mode 100644 index 3ef7184..0000000 --- a/examples/typescript/core/steps/lambda-step-example.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { DurableContext, withDurableExecution } from "@aws/durable-execution-sdk-js"; - -export const handler = withDurableExecution( - async (event: any, context: DurableContext) => { - // Lambda without a name - const result = await context.step(async () => "some value"); - return result; - }, -); diff --git a/examples/typescript/core/wait/appropriate-durations.ts b/examples/typescript/core/wait/appropriate-durations.ts deleted file mode 100644 index bdfa2ab..0000000 --- a/examples/typescript/core/wait/appropriate-durations.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Short wait for rate limiting -await context.wait({ seconds: 30 }); - -// Medium wait for polling intervals -await context.wait({ minutes: 5 }); - -// Long wait for scheduled tasks -await context.wait({ hours: 24 }); diff --git a/examples/typescript/core/wait/duration-from-seconds.ts b/examples/typescript/core/wait/duration-from-seconds.ts deleted file mode 100644 index ae5d0e3..0000000 --- a/examples/typescript/core/wait/duration-from-seconds.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Wait for 300 seconds (5 minutes) -await context.wait({ seconds: 300 }); diff --git a/examples/typescript/core/wait/minimum-wait-duration.ts b/examples/typescript/core/wait/minimum-wait-duration.ts deleted file mode 100644 index c428757..0000000 --- a/examples/typescript/core/wait/minimum-wait-duration.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Avoid - too short, will raise an error -await context.wait({ seconds: 0 }); - -// Minimum - 1 second -await context.wait({ seconds: 1 }); - -// Better - use meaningful durations -await context.wait({ seconds: 5 }); diff --git a/examples/typescript/core/wait/multiple-named-waits.ts b/examples/typescript/core/wait/multiple-named-waits.ts deleted file mode 100644 index f378d01..0000000 --- a/examples/typescript/core/wait/multiple-named-waits.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Good - clear purpose -await context.wait("rate_limit_cooldown", { seconds: 60 }); -await context.wait("polling_interval", { minutes: 5 }); - -// Less clear - unnamed waits -await context.wait({ seconds: 60 }); -await context.wait({ minutes: 5 }); diff --git a/examples/typescript/core/wait/polling-with-condition.ts b/examples/typescript/core/wait/polling-with-condition.ts deleted file mode 100644 index afb2397..0000000 --- a/examples/typescript/core/wait/polling-with-condition.ts +++ /dev/null @@ -1,20 +0,0 @@ -export const handler = withDurableExecution( - async (event: any, context: DurableContext) => { - const result = await context.waitForCondition( - async (state: { jobId: string; status: string }) => { - const status = await getJobStatus(state.jobId); - return { ...state, status }; - }, - { - initialState: { jobId: "job-123", status: "pending" }, - waitStrategy: (state, attempt) => { - if (state.status === "completed") { - return { shouldContinue: false }; - } - return { shouldContinue: true, delay: { seconds: 60 } }; - }, - }, - ); - return result; - }, -); diff --git a/examples/typescript/core/wait/wait-between-steps.ts b/examples/typescript/core/wait/wait-between-steps.ts deleted file mode 100644 index 6991492..0000000 --- a/examples/typescript/core/wait/wait-between-steps.ts +++ /dev/null @@ -1,16 +0,0 @@ -export const handler = withDurableExecution( - async (event: any, context: DurableContext) => { - // Start a process - const jobId = await context.step("start_job", async () => startJob()); - - // Wait before checking status - await context.wait("initial_delay", { seconds: 30 }); - - // Check status - const status = await context.step("check_status", async () => - checkJobStatus(jobId), - ); - - return { jobId, status }; - }, -); diff --git a/examples/typescript/core/wait/wait-for-external-response.ts b/examples/typescript/core/wait/wait-for-external-response.ts deleted file mode 100644 index af23d28..0000000 --- a/examples/typescript/core/wait/wait-for-external-response.ts +++ /dev/null @@ -1,13 +0,0 @@ -export const handler = withDurableExecution( - async (event: any, context: DurableContext) => { - // Wait for external approval - const result = await context.waitForCallback( - "approval_wait", - async (callbackId) => { - // Send callback_id to external approval system - await sendToApprovalSystem(callbackId); - }, - ); - return result; - }, -); diff --git a/examples/typescript/getting-started/custom-client.ts b/examples/typescript/getting-started/custom-client.ts deleted file mode 100644 index 61711f0..0000000 --- a/examples/typescript/getting-started/custom-client.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { LambdaClient } from "@aws-sdk/client-lambda"; -import { - DurableContext, - withDurableExecution, - DurableExecutionConfig, -} from "@aws/durable-execution-sdk-js"; - -const customClient = new LambdaClient({ - region: "us-west-2", - maxAttempts: 5, - retryMode: "adaptive", -}); - -const config: DurableExecutionConfig = { client: customClient }; - -export const handler = withDurableExecution( - async (event: Record, context: DurableContext) => { - // Your durable function logic - return { status: "success" }; - }, - config, -); diff --git a/examples/typescript/getting-started/test-locally.ts b/examples/typescript/getting-started/test-locally.ts deleted file mode 100644 index 6f5c811..0000000 --- a/examples/typescript/getting-started/test-locally.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { LocalDurableTestRunner } from "@aws/durable-execution-sdk-js-testing"; -import { ExecutionStatus } from "@aws-sdk/client-lambda"; -import { handler } from "./write-function"; - -beforeAll(async () => { - await LocalDurableTestRunner.setupTestEnvironment(); -}); - -afterAll(async () => { - await LocalDurableTestRunner.teardownTestEnvironment(); -}); - -test("my function", async () => { - const runner = new LocalDurableTestRunner({ handlerFunction: handler }); - - const result = await runner.run({ payload: { data: "test" } }); - - expect(result.getStatus()).toBe(ExecutionStatus.SUCCEEDED); - expect(result.getResult()).toBe("processed-test"); -}); diff --git a/examples/typescript/getting-started/write-function.ts b/examples/typescript/getting-started/write-function.ts deleted file mode 100644 index 98d9f92..0000000 --- a/examples/typescript/getting-started/write-function.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { - DurableContext, - withDurableExecution, -} from "@aws/durable-execution-sdk-js"; - -export const handler = withDurableExecution( - async (event: { data: string }, context: DurableContext) => { - const result = await context.step("my-step", async () => { - // Your business logic here - return `processed-${event.data}`; - }); - return result; - }, -); diff --git a/examples/typescript/index/quick-example.ts b/examples/typescript/index/quick-example.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/index/quick-example.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/operations/child-contexts/basic-child-context-testing.ts b/examples/typescript/operations/child-contexts/basic-child-context-testing.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/operations/child-contexts/basic-child-context-testing.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/operations/child-contexts/data-processing.ts b/examples/typescript/operations/child-contexts/data-processing.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/operations/child-contexts/data-processing.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/operations/child-contexts/decorator-example.ts b/examples/typescript/operations/child-contexts/decorator-example.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/operations/child-contexts/decorator-example.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/operations/child-contexts/inspect-child-context-operations.ts b/examples/typescript/operations/child-contexts/inspect-child-context-operations.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/operations/child-contexts/inspect-child-context-operations.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/operations/child-contexts/inventory-check.ts b/examples/typescript/operations/child-contexts/inventory-check.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/operations/child-contexts/inventory-check.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/operations/child-contexts/process-order.ts b/examples/typescript/operations/child-contexts/process-order.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/operations/child-contexts/process-order.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/operations/child-contexts/process-region-a.ts b/examples/typescript/operations/child-contexts/process-region-a.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/operations/child-contexts/process-region-a.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/operations/child-contexts/risky-operation.ts b/examples/typescript/operations/child-contexts/risky-operation.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/operations/child-contexts/risky-operation.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/operations/child-contexts/send-notifications.ts b/examples/typescript/operations/child-contexts/send-notifications.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/operations/child-contexts/send-notifications.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/operations/child-contexts/standard-processing.ts b/examples/typescript/operations/child-contexts/standard-processing.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/operations/child-contexts/standard-processing.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/operations/child-contexts/test-error-handling.ts b/examples/typescript/operations/child-contexts/test-error-handling.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/operations/child-contexts/test-error-handling.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/operations/child-contexts/test-large-data-handling.ts b/examples/typescript/operations/child-contexts/test-large-data-handling.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/operations/child-contexts/test-large-data-handling.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/operations/child-contexts/validate-order.ts b/examples/typescript/operations/child-contexts/validate-order.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/operations/child-contexts/validate-order.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/operations/steps/process-payment.ts b/examples/typescript/operations/steps/process-payment.ts deleted file mode 100644 index 0c8e034..0000000 --- a/examples/typescript/operations/steps/process-payment.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { - DurableContext, - StepContext, - withDurableExecution, -} from "@aws/durable-execution-sdk-js"; - -async function processPayment(ctx: StepContext, amount: number): Promise { - return { status: "completed", amount }; -} - -export const handler = withDurableExecution( - async (event: any, context: DurableContext) => { - // Step is automatically named "processPayment" - const result = await context.step("process_payment", (ctx) => - processPayment(ctx, 100.0), - ); - return result; - }, -); diff --git a/examples/typescript/sdk-reference/error-handling/base-exception.ts b/examples/typescript/sdk-reference/error-handling/base-exception.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/base-exception.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/callback-error.ts b/examples/typescript/sdk-reference/error-handling/callback-error.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/callback-error.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/callback-timeout.ts b/examples/typescript/sdk-reference/error-handling/callback-timeout.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/callback-timeout.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/checkpoint-failed.ts b/examples/typescript/sdk-reference/error-handling/checkpoint-failed.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/checkpoint-failed.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/execution-error.ts b/examples/typescript/sdk-reference/error-handling/execution-error.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/execution-error.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/faq-error-details.ts b/examples/typescript/sdk-reference/error-handling/faq-error-details.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/faq-error-details.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/faq-parallel-errors.ts b/examples/typescript/sdk-reference/error-handling/faq-parallel-errors.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/faq-parallel-errors.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/faq-prevent-duplicates.ts b/examples/typescript/sdk-reference/error-handling/faq-prevent-duplicates.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/faq-prevent-duplicates.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/faq-retry-specific.ts b/examples/typescript/sdk-reference/error-handling/faq-retry-specific.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/faq-retry-specific.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/input-validation.ts b/examples/typescript/sdk-reference/error-handling/input-validation.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/input-validation.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/invocation-error.ts b/examples/typescript/sdk-reference/error-handling/invocation-error.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/invocation-error.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/multiple-error-types.ts b/examples/typescript/sdk-reference/error-handling/multiple-error-types.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/multiple-error-types.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/permanent-failures.ts b/examples/typescript/sdk-reference/error-handling/permanent-failures.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/permanent-failures.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/retries-exhausted.ts b/examples/typescript/sdk-reference/error-handling/retries-exhausted.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/retries-exhausted.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/retry-specific-exceptions.ts b/examples/typescript/sdk-reference/error-handling/retry-specific-exceptions.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/retry-specific-exceptions.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/retry-strategy-config.ts b/examples/typescript/sdk-reference/error-handling/retry-strategy-config.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/retry-strategy-config.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/step-interrupted-error.ts b/examples/typescript/sdk-reference/error-handling/step-interrupted-error.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/step-interrupted-error.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/test-error-conditions.ts b/examples/typescript/sdk-reference/error-handling/test-error-conditions.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/test-error-conditions.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/test-inspect-error-details.ts b/examples/typescript/sdk-reference/error-handling/test-inspect-error-details.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/test-inspect-error-details.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/test-retry-behavior.ts b/examples/typescript/sdk-reference/error-handling/test-retry-behavior.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/test-retry-behavior.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/test-retry-exhaustion.ts b/examples/typescript/sdk-reference/error-handling/test-retry-exhaustion.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/test-retry-exhaustion.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/test-sdk-validation.ts b/examples/typescript/sdk-reference/error-handling/test-sdk-validation.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/test-sdk-validation.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/test-successful-execution.ts b/examples/typescript/sdk-reference/error-handling/test-successful-execution.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/test-successful-execution.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/transient-failures.ts b/examples/typescript/sdk-reference/error-handling/transient-failures.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/transient-failures.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/unrecoverable-error.ts b/examples/typescript/sdk-reference/error-handling/unrecoverable-error.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/sdk-reference/error-handling/unrecoverable-error.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/sdk-reference/error-handling/unreliable-operation.ts b/examples/typescript/sdk-reference/error-handling/unreliable-operation.ts deleted file mode 100644 index c694f01..0000000 --- a/examples/typescript/sdk-reference/error-handling/unreliable-operation.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { - DurableContext, - StepConfig, - createRetryStrategy, - withDurableExecution, -} from "@aws/durable-execution-sdk-js"; - -class TransientError extends Error {} - -const stepConfig: StepConfig = { - retryStrategy: createRetryStrategy({ - maxAttempts: 3, - retryableErrorTypes: [TransientError], - }), -}; - -async function unreliableOperation(): Promise { - if (Math.random() > 0.5) throw new TransientError("Random error occurred"); - return "Operation succeeded"; -} - -export const handler = withDurableExecution( - async (event: any, context: DurableContext) => { - const result = await context.step( - "unreliable_operation", - async () => unreliableOperation(), - stepConfig, - ); - return result; - }, -); diff --git a/examples/typescript/sdk-reference/serialization/pass-through-serdes.ts b/examples/typescript/sdk-reference/serialization/pass-through-serdes.ts deleted file mode 100644 index d827545..0000000 --- a/examples/typescript/sdk-reference/serialization/pass-through-serdes.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { - DurableContext, - Serdes, - SerdesContext, - StepConfig, - withDurableExecution, -} from "@aws/durable-execution-sdk-js"; - -// A pass-through serdes returns the value as-is (already a JSON string). -const passThroughSerdes: Serdes = { - serialize: async (value: string | undefined, _ctx: SerdesContext) => value, - deserialize: async (data: string | undefined, _ctx: SerdesContext) => data, -}; - -export const handler = withDurableExecution( - async (event: unknown, context: DurableContext) => { - const config: StepConfig = { serdes: passThroughSerdes }; - const raw = await context.step( - "fetch-raw", - async (): Promise => '{"id":"order-123"}', - config, - ); - return raw; - }, -); diff --git a/examples/typescript/testing-patterns/basic-tests/add-docstrings.ts b/examples/typescript/testing-patterns/basic-tests/add-docstrings.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/add-docstrings.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/basic-step-testing.ts b/examples/typescript/testing-patterns/basic-tests/basic-step-testing.ts deleted file mode 100644 index 6b35be4..0000000 --- a/examples/typescript/testing-patterns/basic-tests/basic-step-testing.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { - LocalDurableTestRunner, - OperationStatus, -} from "@aws/durable-execution-sdk-js-testing"; -import { ExecutionStatus } from "@aws-sdk/client-lambda"; -import { handler } from "./add-numbers"; - -let runner: LocalDurableTestRunner; - -beforeAll(async () => { - await LocalDurableTestRunner.setupTestEnvironment({ skipTime: true }); -}); - -afterAll(async () => { - await LocalDurableTestRunner.teardownTestEnvironment(); -}); - -beforeEach(() => { - runner = new LocalDurableTestRunner({ handlerFunction: handler }); -}); - -it("should execute a step and return the result", async () => { - const result = await runner.run(); - - expect(result.getStatus()).toBe(ExecutionStatus.SUCCEEDED); - expect(result.getResult()).toBe(8); -}); diff --git a/examples/typescript/testing-patterns/basic-tests/callback-function.ts b/examples/typescript/testing-patterns/basic-tests/callback-function.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/callback-function.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/check-expected-failures.ts b/examples/typescript/testing-patterns/basic-tests/check-expected-failures.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/check-expected-failures.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/check-success.ts b/examples/typescript/testing-patterns/basic-tests/check-success.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/check-success.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/check-timeout.ts b/examples/typescript/testing-patterns/basic-tests/check-timeout.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/check-timeout.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/child-context-function.ts b/examples/typescript/testing-patterns/basic-tests/child-context-function.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/child-context-function.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/conftest-setup.ts b/examples/typescript/testing-patterns/basic-tests/conftest-setup.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/conftest-setup.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/descriptive-test-names.ts b/examples/typescript/testing-patterns/basic-tests/descriptive-test-names.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/descriptive-test-names.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/group-related-tests.ts b/examples/typescript/testing-patterns/basic-tests/group-related-tests.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/group-related-tests.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/inspect-step-results.ts b/examples/typescript/testing-patterns/basic-tests/inspect-step-results.ts deleted file mode 100644 index 9ab4964..0000000 --- a/examples/typescript/testing-patterns/basic-tests/inspect-step-results.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { - LocalDurableTestRunner, - OperationStatus, -} from "@aws/durable-execution-sdk-js-testing"; -import { ExecutionStatus } from "@aws-sdk/client-lambda"; -import { handler } from "./handler-with-error"; - -let runner: LocalDurableTestRunner; - -beforeAll(async () => { - await LocalDurableTestRunner.setupTestEnvironment({ skipTime: true }); -}); - -afterAll(async () => { - await LocalDurableTestRunner.teardownTestEnvironment(); -}); - -beforeEach(() => { - runner = new LocalDurableTestRunner({ handlerFunction: handler }); -}); - -it("should fail when step throws an unretried error", async () => { - const result = await runner.run(); - - expect(result.getStatus()).toBe(ExecutionStatus.FAILED); - expect(result.getError().errorMessage).toBeDefined(); -}); diff --git a/examples/typescript/testing-patterns/basic-tests/keep-tests-focused.ts b/examples/typescript/testing-patterns/basic-tests/keep-tests-focused.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/keep-tests-focused.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/parallel-function.ts b/examples/typescript/testing-patterns/basic-tests/parallel-function.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/parallel-function.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/parametrized-tests.ts b/examples/typescript/testing-patterns/basic-tests/parametrized-tests.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/parametrized-tests.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/simple-function.ts b/examples/typescript/testing-patterns/basic-tests/simple-function.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/simple-function.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/simple-test.ts b/examples/typescript/testing-patterns/basic-tests/simple-test.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/simple-test.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/step-function.ts b/examples/typescript/testing-patterns/basic-tests/step-function.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/step-function.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/test-error-handling.ts b/examples/typescript/testing-patterns/basic-tests/test-error-handling.ts deleted file mode 100644 index b713f4a..0000000 --- a/examples/typescript/testing-patterns/basic-tests/test-error-handling.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { - LocalDurableTestRunner, - OperationStatus, - OperationType, -} from "@aws/durable-execution-sdk-js-testing"; -import { ExecutionStatus } from "@aws-sdk/client-lambda"; -import { handler } from "./add-numbers"; - -let runner: LocalDurableTestRunner; - -beforeAll(async () => { - await LocalDurableTestRunner.setupTestEnvironment({ skipTime: true }); -}); - -afterAll(async () => { - await LocalDurableTestRunner.teardownTestEnvironment(); -}); - -beforeEach(() => { - runner = new LocalDurableTestRunner({ handlerFunction: handler }); -}); - -it("should inspect step result by name", async () => { - const stepOp = runner.getOperation("add_numbers"); - - const result = await runner.run(); - - expect(result.getStatus()).toBe(ExecutionStatus.SUCCEEDED); - - const details = stepOp.getStepDetails(); - expect(details?.result).toBeDefined(); - expect(stepOp.getStatus()).toBe(OperationStatus.SUCCEEDED); -}); diff --git a/examples/typescript/testing-patterns/basic-tests/test-retry-behavior.ts b/examples/typescript/testing-patterns/basic-tests/test-retry-behavior.ts deleted file mode 100644 index 8cfbbdc..0000000 --- a/examples/typescript/testing-patterns/basic-tests/test-retry-behavior.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { - LocalDurableTestRunner, - OperationStatus, -} from "@aws/durable-execution-sdk-js-testing"; -import { ExecutionStatus } from "@aws-sdk/client-lambda"; -import { handler } from "./unreliable-operation"; - -let runner: LocalDurableTestRunner; - -beforeAll(async () => { - await LocalDurableTestRunner.setupTestEnvironment({ skipTime: true }); -}); - -afterAll(async () => { - await LocalDurableTestRunner.teardownTestEnvironment(); -}); - -beforeEach(() => { - runner = new LocalDurableTestRunner({ handlerFunction: handler }); -}); - -it("should retry and eventually succeed", async () => { - const result = await runner.run(); - - expect(result.getStatus()).toBe(ExecutionStatus.SUCCEEDED); - - const stepOp = runner.getOperation("unreliable_operation"); - expect(stepOp.getStatus()).toBe(OperationStatus.SUCCEEDED); -}); diff --git a/examples/typescript/testing-patterns/basic-tests/test-wait-operation.ts b/examples/typescript/testing-patterns/basic-tests/test-wait-operation.ts deleted file mode 100644 index 5b52b75..0000000 --- a/examples/typescript/testing-patterns/basic-tests/test-wait-operation.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { - LocalDurableTestRunner, - OperationType, - OperationStatus, -} from "@aws/durable-execution-sdk-js-testing"; -import { handler } from "./wait"; - -let runner: LocalDurableTestRunner; - -beforeAll(async () => { - await LocalDurableTestRunner.setupTestEnvironment({ skipTime: true }); -}); - -afterAll(async () => { - await LocalDurableTestRunner.teardownTestEnvironment(); -}); - -beforeEach(() => { - runner = new LocalDurableTestRunner({ handlerFunction: handler }); -}); - -it("should complete wait operation", async () => { - const result = await runner.run(); - - expect(result.getResult()).toBe("Wait completed"); - - const waitOp = runner.getOperationByIndex(0); - expect(waitOp.getType()).toBe(OperationType.WAIT); - expect(waitOp.getStatus()).toBe(OperationStatus.SUCCEEDED); - expect(waitOp.getWaitDetails()?.waitSeconds).toBe(5); - expect(waitOp.getWaitDetails()?.scheduledEndTimestamp).toBeInstanceOf(Date); -}); diff --git a/examples/typescript/testing-patterns/basic-tests/use-fixtures.ts b/examples/typescript/testing-patterns/basic-tests/use-fixtures.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/use-fixtures.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/verify-callback-operations.ts b/examples/typescript/testing-patterns/basic-tests/verify-callback-operations.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/verify-callback-operations.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/verify-child-context.ts b/examples/typescript/testing-patterns/basic-tests/verify-child-context.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/verify-child-context.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/verify-complex-values.ts b/examples/typescript/testing-patterns/basic-tests/verify-complex-values.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/verify-complex-values.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/verify-list-results.ts b/examples/typescript/testing-patterns/basic-tests/verify-list-results.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/verify-list-results.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/verify-parallel-operations.ts b/examples/typescript/testing-patterns/basic-tests/verify-parallel-operations.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/verify-parallel-operations.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/verify-simple-values.ts b/examples/typescript/testing-patterns/basic-tests/verify-simple-values.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/verify-simple-values.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/verify-step-operations.ts b/examples/typescript/testing-patterns/basic-tests/verify-step-operations.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/verify-step-operations.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/verify-wait-operations.ts b/examples/typescript/testing-patterns/basic-tests/verify-wait-operations.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/verify-wait-operations.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/basic-tests/wait-function.ts b/examples/typescript/testing-patterns/basic-tests/wait-function.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/basic-tests/wait-function.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/basic-parallel-workflow.ts b/examples/typescript/testing-patterns/complex-workflows/basic-parallel-workflow.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/basic-parallel-workflow.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/callback-timeouts-workflow.ts b/examples/typescript/testing-patterns/complex-workflows/callback-timeouts-workflow.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/callback-timeouts-workflow.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/conditional-branching-workflow.ts b/examples/typescript/testing-patterns/complex-workflows/conditional-branching-workflow.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/conditional-branching-workflow.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/expected-failures-workflow.ts b/examples/typescript/testing-patterns/complex-workflows/expected-failures-workflow.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/expected-failures-workflow.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/long-waits-workflow.ts b/examples/typescript/testing-patterns/complex-workflows/long-waits-workflow.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/long-waits-workflow.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/maximum-attempts-workflow.ts b/examples/typescript/testing-patterns/complex-workflows/maximum-attempts-workflow.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/maximum-attempts-workflow.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/multiple-child-contexts-workflow.ts b/examples/typescript/testing-patterns/complex-workflows/multiple-child-contexts-workflow.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/multiple-child-contexts-workflow.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/partial-failures-workflow.ts b/examples/typescript/testing-patterns/complex-workflows/partial-failures-workflow.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/partial-failures-workflow.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/processing-collections-workflow.ts b/examples/typescript/testing-patterns/complex-workflows/processing-collections-workflow.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/processing-collections-workflow.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/retry-behavior-workflow.ts b/examples/typescript/testing-patterns/complex-workflows/retry-behavior-workflow.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/retry-behavior-workflow.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/sequential-workflow.ts b/examples/typescript/testing-patterns/complex-workflows/sequential-workflow.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/sequential-workflow.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/single-child-context-workflow.ts b/examples/typescript/testing-patterns/complex-workflows/single-child-context-workflow.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/single-child-context-workflow.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/test-basic-parallel.ts b/examples/typescript/testing-patterns/complex-workflows/test-basic-parallel.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/test-basic-parallel.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/test-callback-timeouts.ts b/examples/typescript/testing-patterns/complex-workflows/test-callback-timeouts.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/test-callback-timeouts.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/test-conditional-branching.ts b/examples/typescript/testing-patterns/complex-workflows/test-conditional-branching.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/test-conditional-branching.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/test-expected-failures.ts b/examples/typescript/testing-patterns/complex-workflows/test-expected-failures.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/test-expected-failures.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/test-long-waits.ts b/examples/typescript/testing-patterns/complex-workflows/test-long-waits.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/test-long-waits.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/test-maximum-attempts.ts b/examples/typescript/testing-patterns/complex-workflows/test-maximum-attempts.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/test-maximum-attempts.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/test-multiple-child-contexts.ts b/examples/typescript/testing-patterns/complex-workflows/test-multiple-child-contexts.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/test-multiple-child-contexts.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/test-partial-failures.ts b/examples/typescript/testing-patterns/complex-workflows/test-partial-failures.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/test-partial-failures.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/test-processing-collections.ts b/examples/typescript/testing-patterns/complex-workflows/test-processing-collections.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/test-processing-collections.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/test-retry-behavior.ts b/examples/typescript/testing-patterns/complex-workflows/test-retry-behavior.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/test-retry-behavior.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/test-sequential-operations.ts b/examples/typescript/testing-patterns/complex-workflows/test-sequential-operations.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/test-sequential-operations.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/test-single-child-context.ts b/examples/typescript/testing-patterns/complex-workflows/test-single-child-context.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/test-single-child-context.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/test-wait-for-condition.ts b/examples/typescript/testing-patterns/complex-workflows/test-wait-for-condition.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/test-wait-for-condition.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/complex-workflows/wait-for-condition-workflow.ts b/examples/typescript/testing-patterns/complex-workflows/wait-for-condition-workflow.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/complex-workflows/wait-for-condition-workflow.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/stores/filesystem-store.ts b/examples/typescript/testing-patterns/stores/filesystem-store.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/stores/filesystem-store.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/stores/in-memory-store.ts b/examples/typescript/testing-patterns/stores/in-memory-store.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/stores/in-memory-store.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/examples/typescript/testing-patterns/stores/programmatic-config.ts b/examples/typescript/testing-patterns/stores/programmatic-config.ts deleted file mode 100644 index 48cdd22..0000000 --- a/examples/typescript/testing-patterns/stores/programmatic-config.ts +++ /dev/null @@ -1 +0,0 @@ -// Coming soon... diff --git a/scripts/check_example_refs.py b/scripts/check_example_refs.py new file mode 100644 index 0000000..eb04358 --- /dev/null +++ b/scripts/check_example_refs.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +"""Verify that examples/ and docs/ snippet includes stay in sync. + +Fails when an example file is not referenced by any ``--8<--`` include in +docs/ (an orphan), or when an include references a file that does not +exist (a broken include). Run from the repository root: + + python3 scripts/check_example_refs.py +""" + +from __future__ import annotations + +import re +import sys +from pathlib import Path + +INCLUDE_PATTERN = re.compile(r'--8<--\s+"(examples/[^"]+)"') + + +def main() -> int: + root = Path(__file__).resolve().parent.parent + docs_dir = root / "docs" + examples_dir = root / "examples" + + included: set[str] = set() + for page in docs_dir.rglob("*.md"): + included.update(INCLUDE_PATTERN.findall(page.read_text(encoding="utf-8"))) + + on_disk = { + str(path.relative_to(root)) + for path in examples_dir.rglob("*") + if path.is_file() + } + + orphans = sorted(on_disk - included) + missing = sorted(included - on_disk) + + for path in orphans: + print(f"orphaned example (not included by any docs page): {path}") + for path in missing: + print(f"broken include (file does not exist): {path}") + + if orphans or missing: + print( + f"\n{len(orphans)} orphaned example file(s), " + f"{len(missing)} broken include(s)." + ) + return 1 + + print(f"OK: {len(on_disk)} example files, all referenced; no broken includes.") + return 0 + + +if __name__ == "__main__": + sys.exit(main())