modmex-lambda 0.5.10__tar.gz → 0.5.11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/.gitignore +5 -1
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/PKG-INFO +2 -2
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/dependencies/params.py +0 -2
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/params.py +8 -12
- modmex_lambda-0.5.11/modmex_lambda/stream/runner.py +119 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/sources/base.py +3 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/sources/dynamodb.py +4 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/sources/kinesis.py +4 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/sources/s3.py +4 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/sources/sns.py +4 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/sources/sqs.py +4 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/faults.py +12 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/poetry.lock +116 -131
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/pyproject.toml +2 -2
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/event_handler/test_dependencies.py +10 -3
- modmex_lambda-0.5.11/tests/stream/filters/__init__.py +0 -0
- modmex_lambda-0.5.11/tests/stream/flavors/__init__.py +0 -0
- modmex_lambda-0.5.11/tests/stream/test_faults.py +64 -0
- modmex_lambda-0.5.11/tests/stream/utils/__init__.py +0 -0
- modmex_lambda-0.5.10/modmex_lambda/stream/runner.py +0 -109
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/.github/workflows/ci.yml +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/.github/workflows/release.yml +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/LICENSE +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/README.md +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/connectors/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/connectors/cloudwatch.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/connectors/dynamodb.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/connectors/eventbridge.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/connectors/icloudwatch.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/connectors/idynamodb.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/connectors/ieventbridge.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/connectors/ilambda.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/connectors/is3.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/connectors/isns.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/connectors/isqs.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/connectors/lambda_.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/connectors/module.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/connectors/s3.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/connectors/sns.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/connectors/sqs.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/data_classes/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/data_classes/api_gateway_authorizer_event.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/data_classes/api_gateway_proxy_event.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/data_classes/api_gateway_websocket_event.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/data_classes/cognito_user_pool_event.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/data_classes/common.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/dependencies.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/api_gateway.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/constants.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/content_types.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/cors.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/dependencies/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/dependencies/compat.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/dependencies/dependant.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/dependencies/dependency_middleware.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/dependencies/depends.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/dependencies/types.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/exception_handler.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/exceptions.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/gateway_response.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/middlewares.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/request.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/response.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/routing.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/routing_fallbacks.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/types.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_sources.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/exceptions.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/logging.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/params.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/parser.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/persistence/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/persistence/dynamodb/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/persistence/dynamodb/expressions.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/persistence/dynamodb/keys.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/persistence/dynamodb/materialized_views.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/persistence/dynamodb/stream_fields.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/py.typed +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/request.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/resolver.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/response.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/routing.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/shared/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/shared/cookies.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/shared/headers_serializer.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/shared/json_encoder.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/shared/types.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/events/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/events/dynamodb.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/events/kinesis.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/events/s3.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/events/sns.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/events/sqs.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/filters/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/filters/content.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/filters/event_type.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/filters/latch.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/filters/skip.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/flavors/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/flavors/base_flavor.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/flavors/cdc.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/flavors/collect.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/flavors/correlate.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/flavors/evaluate.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/flavors/expired.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/flavors/iflavor.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/flavors/job.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/flavors/materialize.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/flavors/s3.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/flavors/sns.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/flavors/task.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/flavors/update.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/irules_registry.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/operators/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/operators/cloudwatch.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/operators/dynamodb.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/operators/ioperator.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/operators/lambda_.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/operators/publisher.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/operators/s3.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/operators/sns.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/operators/sqs.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/rules_registry.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/sources/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/apigateway.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/aws.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/batch.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/cloudwatch.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/concurrency.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/contracts.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/data_classes/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/data_classes/dynamodb.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/decorators.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/dynamodb.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/eventbridge.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/filters.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/json_encoder.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/lambda_.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/operators.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/pluralize.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/print.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/retry.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/s3.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/sns.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/split.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/sqs.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/tags.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/time.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/stream/utils/uow.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/tracing.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/validation.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/conftest.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/connectors/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/connectors/conftest.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/connectors/test_cloudwatch.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/connectors/test_dynamodb.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/connectors/test_lazy_clients.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/connectors/test_s3.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/connectors/test_simple_connectors.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/connectors/test_sns.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/connectors/test_sqs.py +0 -0
- {modmex_lambda-0.5.10/tests/event_handler → modmex_lambda-0.5.11/tests/data_classes}/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/data_classes/test_api_gateway_proxy_event.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/data_classes/test_cognito_user_pool_event.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/data_classes/test_common.py +0 -0
- {modmex_lambda-0.5.10/tests/stream → modmex_lambda-0.5.11/tests/event_handler}/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/event_handler/test_api_gateway.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/event_handler/test_cors.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/event_handler/test_exception_handler.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/event_handler/test_gateway_response.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/event_handler/test_request.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/event_handler/test_response.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/event_handler/test_routing.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/persistence/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/persistence/test_dynamodb_expressions.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/persistence/test_dynamodb_keys.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/persistence/test_dynamodb_materialized_views.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/persistence/test_dynamodb_stream_fields.py +0 -0
- {modmex_lambda-0.5.10/tests/stream/filters → modmex_lambda-0.5.11/tests/shared}/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/shared/test_cookies_headers.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/shared/test_json_encoder.py +0 -0
- {modmex_lambda-0.5.10/tests/stream/flavors → modmex_lambda-0.5.11/tests/stream}/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/conftest.py +0 -0
- {modmex_lambda-0.5.10/tests/stream/utils → modmex_lambda-0.5.11/tests/stream/events}/__init__.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/events/test_dynamodb.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/events/test_kinesis.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/events/test_s3.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/events/test_sns.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/events/test_sqs.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/filters/test_content.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/filters/test_event_type.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/filters/test_latch.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/filters/test_skip.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/flavors/source_events.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/flavors/test_base_flavor.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/flavors/test_cdc.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/flavors/test_collect.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/flavors/test_correlate.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/flavors/test_evaluate.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/flavors/test_expired.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/flavors/test_job.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/flavors/test_materialize.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/flavors/test_s3.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/flavors/test_sns.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/flavors/test_task.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/flavors/test_update.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/test_dependency_resolver.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/test_rules_registry.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/test_runner.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/test_runner_pipeline.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/test_sources.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/faults.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_apigateway.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_aws.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_batch.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_cloudwatch.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_concurrency.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_decorators.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_dynamodb.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_eventbridge.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_filters.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_json_encoder.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_lambda.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_operators.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_pluralize.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_print.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_retry.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_s3.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_sns.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_split.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_sqs.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_tags.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_time.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/stream/utils/test_uow.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/test_lazy_imports.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/test_logging.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/test_parser_event_sources.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/test_reexports.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/test_tracing.py +0 -0
- {modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/tests/test_validation.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: modmex-lambda
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.11
|
|
4
4
|
Summary: Ultra-lightweight AWS Lambda utilities for API Gateway routing and event handling.
|
|
5
5
|
Author: Modmex
|
|
6
6
|
License: MIT
|
|
@@ -13,7 +13,7 @@ Classifier: Programming Language :: Python :: 3.14
|
|
|
13
13
|
Requires-Python: <4.0,>=3.10
|
|
14
14
|
Requires-Dist: boto3<2.0.0,>=1.24.66
|
|
15
15
|
Requires-Dist: injector<1.0.0,>=0.24.0
|
|
16
|
-
Requires-Dist: modmex<2.0.0,>=1.
|
|
16
|
+
Requires-Dist: modmex<2.0.0,>=1.2.0
|
|
17
17
|
Requires-Dist: pydash<9.0.0,>=5.1.2
|
|
18
18
|
Requires-Dist: reactivex<5.0.0,>=4.0.4
|
|
19
19
|
Requires-Dist: typing-extensions<5.0.0,>=4.5.0
|
{modmex_lambda-0.5.10 → modmex_lambda-0.5.11}/modmex_lambda/event_handler/dependencies/params.py
RENAMED
|
@@ -171,8 +171,6 @@ def _resolve_field_info(
|
|
|
171
171
|
|
|
172
172
|
if origin is Annotated:
|
|
173
173
|
return _resolve_annotated(annotation, value, is_path_param)
|
|
174
|
-
if _is_public_param_marker(origin):
|
|
175
|
-
return _field_from_public_marker(origin, args[0] if args else Any, value, is_path_param)
|
|
176
174
|
if _is_public_param_marker(annotation):
|
|
177
175
|
return _field_from_public_marker(annotation, Any, value, is_path_param)
|
|
178
176
|
if origin is Response:
|
|
@@ -5,40 +5,36 @@ Use these markers with ``Annotated[T, Body()]`` style annotations.
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
-
from typing import Generic, TypeVar
|
|
9
|
-
|
|
10
8
|
from modmex import BaseModel
|
|
11
9
|
|
|
12
|
-
T = TypeVar("T")
|
|
13
|
-
|
|
14
10
|
|
|
15
|
-
class Param(BaseModel
|
|
11
|
+
class Param(BaseModel):
|
|
16
12
|
name: str | None = None
|
|
17
13
|
|
|
18
14
|
|
|
19
|
-
class Body(Param
|
|
15
|
+
class Body(Param):
|
|
20
16
|
pass
|
|
21
17
|
|
|
22
18
|
|
|
23
|
-
class Query(Param
|
|
19
|
+
class Query(Param):
|
|
24
20
|
pass
|
|
25
21
|
|
|
26
22
|
|
|
27
|
-
class Path(Param
|
|
23
|
+
class Path(Param):
|
|
28
24
|
pass
|
|
29
25
|
|
|
30
26
|
|
|
31
|
-
class Header(Param
|
|
27
|
+
class Header(Param):
|
|
32
28
|
pass
|
|
33
29
|
|
|
34
30
|
|
|
35
|
-
class Cookie(Param
|
|
31
|
+
class Cookie(Param):
|
|
36
32
|
pass
|
|
37
33
|
|
|
38
34
|
|
|
39
|
-
class RawEvent(Param
|
|
35
|
+
class RawEvent(Param):
|
|
40
36
|
pass
|
|
41
37
|
|
|
42
38
|
|
|
43
|
-
class LambdaContext(Param
|
|
39
|
+
class LambdaContext(Param):
|
|
44
40
|
pass
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import copy
|
|
2
|
+
import multiprocessing
|
|
3
|
+
import os
|
|
4
|
+
import threading
|
|
5
|
+
from typing import Any, Callable, Iterable, TypedDict
|
|
6
|
+
|
|
7
|
+
from reactivex import Observable, from_list, operators as ops
|
|
8
|
+
from reactivex.scheduler import ThreadPoolScheduler
|
|
9
|
+
from contextvars import Token
|
|
10
|
+
|
|
11
|
+
from modmex_lambda.stream.irules_registry import IRulesRegistry
|
|
12
|
+
from modmex_lambda.stream.utils.eventbridge import publish_to_event_bridge
|
|
13
|
+
from modmex_lambda.stream.utils.faults import flush_faults
|
|
14
|
+
from modmex_lambda.logging import Logger
|
|
15
|
+
from modmex_lambda.stream.utils.operators import tap
|
|
16
|
+
from modmex_lambda.stream.utils.faults import FaultHandler, active_fault_handler
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
PublishFactory = Callable[[dict[str, Any]], Any]
|
|
20
|
+
BusName = str | Callable[[dict[str, Any]], str] | None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class RunOptions(TypedDict, total=False):
|
|
24
|
+
bus_name: BusName
|
|
25
|
+
publish: PublishFactory
|
|
26
|
+
logger: Any
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _publish_to_event_bridge(params: dict[str, Any]) -> Any:
|
|
30
|
+
return publish_to_event_bridge(**params)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def run(
|
|
34
|
+
events: Iterable,
|
|
35
|
+
registry: IRulesRegistry,
|
|
36
|
+
opt: RunOptions | None = None,
|
|
37
|
+
on_next=None,
|
|
38
|
+
on_error=None,
|
|
39
|
+
on_completed=None,
|
|
40
|
+
concurrency=True,
|
|
41
|
+
on_fault: FaultHandler | None = None,
|
|
42
|
+
):
|
|
43
|
+
try:
|
|
44
|
+
opt = {
|
|
45
|
+
'bus_name': os.getenv('BUS_NAME'),
|
|
46
|
+
'publish': _publish_to_event_bridge,
|
|
47
|
+
**(opt or {}),
|
|
48
|
+
}
|
|
49
|
+
optimal_thread_count = multiprocessing.cpu_count()
|
|
50
|
+
pool_scheduler = ThreadPoolScheduler(optimal_thread_count)
|
|
51
|
+
pipeline_logger = opt.get('logger') or Logger()
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
token: Token = active_fault_handler.set(on_fault)
|
|
55
|
+
|
|
56
|
+
def make_lines(flavor):
|
|
57
|
+
source = from_list( # pylint: disable=E1102
|
|
58
|
+
copy.deepcopy(events)
|
|
59
|
+
).pipe(
|
|
60
|
+
ops.map(lambda uow: {
|
|
61
|
+
'pipeline': flavor.id,
|
|
62
|
+
**uow,
|
|
63
|
+
}),
|
|
64
|
+
flavor,
|
|
65
|
+
)
|
|
66
|
+
source.id = flavor.id
|
|
67
|
+
return source
|
|
68
|
+
|
|
69
|
+
lines = list(map(make_lines, registry.build()))
|
|
70
|
+
pending = len(lines)
|
|
71
|
+
completed = threading.Event()
|
|
72
|
+
completed_lock = threading.Lock()
|
|
73
|
+
|
|
74
|
+
if pending == 0:
|
|
75
|
+
completed.set()
|
|
76
|
+
|
|
77
|
+
def mark_completed():
|
|
78
|
+
nonlocal pending
|
|
79
|
+
|
|
80
|
+
with completed_lock:
|
|
81
|
+
pending -= 1
|
|
82
|
+
if pending == 0:
|
|
83
|
+
completed.set()
|
|
84
|
+
|
|
85
|
+
def _emit(source: Observable): #pylint: disable=no-self-use
|
|
86
|
+
def _on_next(pipeline_id, uow):
|
|
87
|
+
if on_next:
|
|
88
|
+
on_next(pipeline_id, uow)
|
|
89
|
+
|
|
90
|
+
def _on_error(pipeline_id, err):
|
|
91
|
+
if on_error:
|
|
92
|
+
on_error(pipeline_id, err)
|
|
93
|
+
mark_completed()
|
|
94
|
+
|
|
95
|
+
def _on_completed(pipeline_id):
|
|
96
|
+
if on_completed:
|
|
97
|
+
on_completed(pipeline_id)
|
|
98
|
+
mark_completed()
|
|
99
|
+
|
|
100
|
+
source.subscribe(
|
|
101
|
+
on_next=lambda i: _on_next(source.id, i),
|
|
102
|
+
on_error=lambda e: _on_error(source.id, e),
|
|
103
|
+
on_completed=lambda *_: _on_completed(source.id),
|
|
104
|
+
**({'scheduler': pool_scheduler} if concurrency else {})
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
from_list(lines).pipe( # pylint: disable=E1102
|
|
108
|
+
tap(_emit)
|
|
109
|
+
).subscribe()
|
|
110
|
+
|
|
111
|
+
completed.wait()
|
|
112
|
+
pool_scheduler.executor.shutdown()
|
|
113
|
+
flush_faults({
|
|
114
|
+
**opt,
|
|
115
|
+
'logger': pipeline_logger,
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
finally:
|
|
119
|
+
active_fault_handler.reset(token)
|
|
@@ -22,6 +22,7 @@ class SourceHandler(Generic[S, E]):
|
|
|
22
22
|
on_next: Optional[Callable] = None,
|
|
23
23
|
on_error: Optional[Callable] = None,
|
|
24
24
|
on_completed: Optional[Callable] = None,
|
|
25
|
+
on_fault: Optional[Callable] = None,
|
|
25
26
|
logger: Optional[object] = None,
|
|
26
27
|
dependency_resolver: Optional[DependencyResolver] = None,
|
|
27
28
|
) -> None:
|
|
@@ -31,6 +32,7 @@ class SourceHandler(Generic[S, E]):
|
|
|
31
32
|
self.on_next = on_next
|
|
32
33
|
self.on_error = on_error
|
|
33
34
|
self.on_completed = on_completed
|
|
35
|
+
self.on_fault = on_fault
|
|
34
36
|
self.logger = logger or Logger()
|
|
35
37
|
self.dependency_resolver = dependency_resolver or default_dependency_resolver()
|
|
36
38
|
self.registry.bind(self.dependency_resolver)
|
|
@@ -57,4 +59,5 @@ class SourceHandler(Generic[S, E]):
|
|
|
57
59
|
on_error=self.on_error,
|
|
58
60
|
on_completed=self.on_completed,
|
|
59
61
|
concurrency=self.concurrency,
|
|
62
|
+
on_fault=self.on_fault,
|
|
60
63
|
)
|
|
@@ -24,6 +24,7 @@ class DynamoDBSource(SourceHandler[DynamoDBStreamEvent, DynamoDBEvent]):
|
|
|
24
24
|
on_next: Optional[Callable] = None,
|
|
25
25
|
on_error: Optional[Callable] = None,
|
|
26
26
|
on_completed: Optional[Callable] = None,
|
|
27
|
+
on_fault: Optional[Callable] = None,
|
|
27
28
|
logger: Optional[object] = None,
|
|
28
29
|
dependency_resolver: Optional[DependencyResolver] = None,
|
|
29
30
|
parser_options: Optional[DynamodbParserOptions] = None,
|
|
@@ -43,6 +44,7 @@ class DynamoDBSource(SourceHandler[DynamoDBStreamEvent, DynamoDBEvent]):
|
|
|
43
44
|
on_next=on_next,
|
|
44
45
|
on_error=on_error,
|
|
45
46
|
on_completed=on_completed,
|
|
47
|
+
on_fault=on_fault,
|
|
46
48
|
logger=logger,
|
|
47
49
|
dependency_resolver=dependency_resolver,
|
|
48
50
|
)
|
|
@@ -55,6 +57,7 @@ def dynamodb_source(
|
|
|
55
57
|
on_next: Optional[Callable] = None,
|
|
56
58
|
on_error: Optional[Callable] = None,
|
|
57
59
|
on_completed: Optional[Callable] = None,
|
|
60
|
+
on_fault: Optional[Callable] = None,
|
|
58
61
|
logger: Optional[object] = None,
|
|
59
62
|
dependency_resolver: Optional[DependencyResolver] = None,
|
|
60
63
|
parser_options: Optional[DynamodbParserOptions] = None,
|
|
@@ -65,6 +68,7 @@ def dynamodb_source(
|
|
|
65
68
|
on_next=on_next,
|
|
66
69
|
on_error=on_error,
|
|
67
70
|
on_completed=on_completed,
|
|
71
|
+
on_fault=on_fault,
|
|
68
72
|
logger=logger,
|
|
69
73
|
dependency_resolver=dependency_resolver,
|
|
70
74
|
parser_options=parser_options,
|
|
@@ -15,6 +15,7 @@ class KinesisSource(SourceHandler):
|
|
|
15
15
|
on_next: Optional[Callable] = None,
|
|
16
16
|
on_error: Optional[Callable] = None,
|
|
17
17
|
on_completed: Optional[Callable] = None,
|
|
18
|
+
on_fault: Optional[Callable] = None,
|
|
18
19
|
logger: Optional[object] = None,
|
|
19
20
|
dependency_resolver: Optional[DependencyResolver] = None,
|
|
20
21
|
) -> None:
|
|
@@ -25,6 +26,7 @@ class KinesisSource(SourceHandler):
|
|
|
25
26
|
on_next=on_next,
|
|
26
27
|
on_error=on_error,
|
|
27
28
|
on_completed=on_completed,
|
|
29
|
+
on_fault=on_fault,
|
|
28
30
|
logger=logger,
|
|
29
31
|
dependency_resolver=dependency_resolver,
|
|
30
32
|
)
|
|
@@ -37,6 +39,7 @@ def kinesis_source(
|
|
|
37
39
|
on_next: Optional[Callable] = None,
|
|
38
40
|
on_error: Optional[Callable] = None,
|
|
39
41
|
on_completed: Optional[Callable] = None,
|
|
42
|
+
on_fault: Optional[Callable] = None,
|
|
40
43
|
logger: Optional[object] = None,
|
|
41
44
|
dependency_resolver: Optional[DependencyResolver] = None,
|
|
42
45
|
):
|
|
@@ -46,6 +49,7 @@ def kinesis_source(
|
|
|
46
49
|
on_next=on_next,
|
|
47
50
|
on_error=on_error,
|
|
48
51
|
on_completed=on_completed,
|
|
52
|
+
on_fault=on_fault,
|
|
49
53
|
logger=logger,
|
|
50
54
|
dependency_resolver=dependency_resolver,
|
|
51
55
|
)
|
|
@@ -15,6 +15,7 @@ class S3Source(SourceHandler):
|
|
|
15
15
|
on_next: Optional[Callable] = None,
|
|
16
16
|
on_error: Optional[Callable] = None,
|
|
17
17
|
on_completed: Optional[Callable] = None,
|
|
18
|
+
on_fault: Optional[Callable] = None,
|
|
18
19
|
logger: Optional[object] = None,
|
|
19
20
|
dependency_resolver: Optional[DependencyResolver] = None,
|
|
20
21
|
) -> None:
|
|
@@ -25,6 +26,7 @@ class S3Source(SourceHandler):
|
|
|
25
26
|
on_next=on_next,
|
|
26
27
|
on_error=on_error,
|
|
27
28
|
on_completed=on_completed,
|
|
29
|
+
on_fault=on_fault,
|
|
28
30
|
logger=logger,
|
|
29
31
|
dependency_resolver=dependency_resolver,
|
|
30
32
|
)
|
|
@@ -37,6 +39,7 @@ def s3_source(
|
|
|
37
39
|
on_next: Optional[Callable] = None,
|
|
38
40
|
on_error: Optional[Callable] = None,
|
|
39
41
|
on_completed: Optional[Callable] = None,
|
|
42
|
+
on_fault: Optional[Callable] = None,
|
|
40
43
|
logger: Optional[object] = None,
|
|
41
44
|
dependency_resolver: Optional[DependencyResolver] = None,
|
|
42
45
|
):
|
|
@@ -46,6 +49,7 @@ def s3_source(
|
|
|
46
49
|
on_next=on_next,
|
|
47
50
|
on_error=on_error,
|
|
48
51
|
on_completed=on_completed,
|
|
52
|
+
on_fault=on_fault,
|
|
49
53
|
logger=logger,
|
|
50
54
|
dependency_resolver=dependency_resolver,
|
|
51
55
|
)
|
|
@@ -15,6 +15,7 @@ class SnsSource(SourceHandler):
|
|
|
15
15
|
on_next: Optional[Callable] = None,
|
|
16
16
|
on_error: Optional[Callable] = None,
|
|
17
17
|
on_completed: Optional[Callable] = None,
|
|
18
|
+
on_fault: Optional[Callable] = None,
|
|
18
19
|
logger: Optional[object] = None,
|
|
19
20
|
dependency_resolver: Optional[DependencyResolver] = None,
|
|
20
21
|
) -> None:
|
|
@@ -25,6 +26,7 @@ class SnsSource(SourceHandler):
|
|
|
25
26
|
on_next=on_next,
|
|
26
27
|
on_error=on_error,
|
|
27
28
|
on_completed=on_completed,
|
|
29
|
+
on_fault=on_fault,
|
|
28
30
|
logger=logger,
|
|
29
31
|
dependency_resolver=dependency_resolver,
|
|
30
32
|
)
|
|
@@ -37,6 +39,7 @@ def sns_source(
|
|
|
37
39
|
on_next: Optional[Callable] = None,
|
|
38
40
|
on_error: Optional[Callable] = None,
|
|
39
41
|
on_completed: Optional[Callable] = None,
|
|
42
|
+
on_fault: Optional[Callable] = None,
|
|
40
43
|
logger: Optional[object] = None,
|
|
41
44
|
dependency_resolver: Optional[DependencyResolver] = None,
|
|
42
45
|
):
|
|
@@ -46,6 +49,7 @@ def sns_source(
|
|
|
46
49
|
on_next=on_next,
|
|
47
50
|
on_error=on_error,
|
|
48
51
|
on_completed=on_completed,
|
|
52
|
+
on_fault=on_fault,
|
|
49
53
|
logger=logger,
|
|
50
54
|
dependency_resolver=dependency_resolver,
|
|
51
55
|
)
|
|
@@ -15,6 +15,7 @@ class SqsSource(SourceHandler):
|
|
|
15
15
|
on_next: Optional[Callable] = None,
|
|
16
16
|
on_error: Optional[Callable] = None,
|
|
17
17
|
on_completed: Optional[Callable] = None,
|
|
18
|
+
on_fault: Optional[Callable] = None,
|
|
18
19
|
logger: Optional[object] = None,
|
|
19
20
|
dependency_resolver: Optional[DependencyResolver] = None,
|
|
20
21
|
) -> None:
|
|
@@ -25,6 +26,7 @@ class SqsSource(SourceHandler):
|
|
|
25
26
|
on_next=on_next,
|
|
26
27
|
on_error=on_error,
|
|
27
28
|
on_completed=on_completed,
|
|
29
|
+
on_fault=on_fault,
|
|
28
30
|
logger=logger,
|
|
29
31
|
dependency_resolver=dependency_resolver,
|
|
30
32
|
)
|
|
@@ -37,6 +39,7 @@ def sqs_source(
|
|
|
37
39
|
on_next: Optional[Callable] = None,
|
|
38
40
|
on_error: Optional[Callable] = None,
|
|
39
41
|
on_completed: Optional[Callable] = None,
|
|
42
|
+
on_fault: Optional[Callable] = None,
|
|
40
43
|
logger: Optional[object] = None,
|
|
41
44
|
dependency_resolver: Optional[DependencyResolver] = None,
|
|
42
45
|
):
|
|
@@ -46,6 +49,7 @@ def sqs_source(
|
|
|
46
49
|
on_next=on_next,
|
|
47
50
|
on_error=on_error,
|
|
48
51
|
on_completed=on_completed,
|
|
52
|
+
on_fault=on_fault,
|
|
49
53
|
logger=logger,
|
|
50
54
|
dependency_resolver=dependency_resolver,
|
|
51
55
|
)
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import traceback
|
|
3
3
|
from uuid import uuid1, uuid4
|
|
4
|
+
from typing import Any, Callable
|
|
5
|
+
from contextvars import ContextVar
|
|
4
6
|
from reactivex import operators as ops, create, Observer
|
|
5
7
|
from pydash import map_, clone_deep_with, pick
|
|
6
8
|
from .time import now
|
|
@@ -10,6 +12,13 @@ FAULT_EVENT_TYPE = 'fault'
|
|
|
10
12
|
|
|
11
13
|
the_faults = []
|
|
12
14
|
|
|
15
|
+
FaultHandler = Callable[[Any], None]
|
|
16
|
+
|
|
17
|
+
active_fault_handler: ContextVar[FaultHandler | None] = ContextVar(
|
|
18
|
+
"reactive_fault_handler",
|
|
19
|
+
default=None,
|
|
20
|
+
)
|
|
21
|
+
|
|
13
22
|
|
|
14
23
|
def throw_fault(uow, ignore=False):
|
|
15
24
|
def wrapper(err):
|
|
@@ -94,6 +103,9 @@ def _trim_and_redact(_uow):
|
|
|
94
103
|
|
|
95
104
|
def faults(err):
|
|
96
105
|
if hasattr(err, 'uow'):
|
|
106
|
+
fault_handler = active_fault_handler.get()
|
|
107
|
+
if fault_handler:
|
|
108
|
+
fault_handler(err)
|
|
97
109
|
the_faults.append(format_fault(err))
|
|
98
110
|
else:
|
|
99
111
|
# raise unhandled/unexpected exceptions to stop processing
|