modmex-lambda 0.5.10__tar.gz → 0.5.12__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.
Files changed (246) hide show
  1. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/.gitignore +5 -1
  2. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/PKG-INFO +2 -2
  3. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/dependencies/params.py +0 -2
  4. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/params.py +8 -12
  5. modmex_lambda-0.5.12/modmex_lambda/stream/runner.py +119 -0
  6. modmex_lambda-0.5.12/modmex_lambda/stream/schedulers.py +15 -0
  7. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/sources/base.py +3 -0
  8. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/sources/dynamodb.py +4 -0
  9. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/sources/kinesis.py +4 -0
  10. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/sources/s3.py +4 -0
  11. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/sources/sns.py +4 -0
  12. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/sources/sqs.py +4 -0
  13. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/faults.py +12 -0
  14. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/poetry.lock +116 -131
  15. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/pyproject.toml +2 -2
  16. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/event_handler/test_dependencies.py +10 -3
  17. modmex_lambda-0.5.12/tests/stream/filters/__init__.py +0 -0
  18. modmex_lambda-0.5.12/tests/stream/flavors/__init__.py +0 -0
  19. modmex_lambda-0.5.12/tests/stream/test_faults.py +63 -0
  20. modmex_lambda-0.5.12/tests/stream/utils/__init__.py +0 -0
  21. modmex_lambda-0.5.10/modmex_lambda/stream/runner.py +0 -109
  22. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/.github/workflows/ci.yml +0 -0
  23. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/.github/workflows/release.yml +0 -0
  24. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/LICENSE +0 -0
  25. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/README.md +0 -0
  26. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/__init__.py +0 -0
  27. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/connectors/__init__.py +0 -0
  28. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/connectors/cloudwatch.py +0 -0
  29. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/connectors/dynamodb.py +0 -0
  30. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/connectors/eventbridge.py +0 -0
  31. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/connectors/icloudwatch.py +0 -0
  32. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/connectors/idynamodb.py +0 -0
  33. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/connectors/ieventbridge.py +0 -0
  34. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/connectors/ilambda.py +0 -0
  35. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/connectors/is3.py +0 -0
  36. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/connectors/isns.py +0 -0
  37. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/connectors/isqs.py +0 -0
  38. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/connectors/lambda_.py +0 -0
  39. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/connectors/module.py +0 -0
  40. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/connectors/s3.py +0 -0
  41. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/connectors/sns.py +0 -0
  42. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/connectors/sqs.py +0 -0
  43. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/data_classes/__init__.py +0 -0
  44. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/data_classes/api_gateway_authorizer_event.py +0 -0
  45. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/data_classes/api_gateway_proxy_event.py +0 -0
  46. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/data_classes/api_gateway_websocket_event.py +0 -0
  47. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/data_classes/cognito_user_pool_event.py +0 -0
  48. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/data_classes/common.py +0 -0
  49. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/dependencies.py +0 -0
  50. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/__init__.py +0 -0
  51. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/api_gateway.py +0 -0
  52. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/constants.py +0 -0
  53. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/content_types.py +0 -0
  54. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/cors.py +0 -0
  55. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/dependencies/__init__.py +0 -0
  56. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/dependencies/compat.py +0 -0
  57. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/dependencies/dependant.py +0 -0
  58. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/dependencies/dependency_middleware.py +0 -0
  59. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/dependencies/depends.py +0 -0
  60. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/dependencies/types.py +0 -0
  61. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/exception_handler.py +0 -0
  62. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/exceptions.py +0 -0
  63. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/gateway_response.py +0 -0
  64. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/middlewares.py +0 -0
  65. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/request.py +0 -0
  66. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/response.py +0 -0
  67. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/routing.py +0 -0
  68. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/routing_fallbacks.py +0 -0
  69. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_handler/types.py +0 -0
  70. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/event_sources.py +0 -0
  71. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/exceptions.py +0 -0
  72. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/logging.py +0 -0
  73. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/params.py +0 -0
  74. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/parser.py +0 -0
  75. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/persistence/__init__.py +0 -0
  76. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/persistence/dynamodb/__init__.py +0 -0
  77. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/persistence/dynamodb/expressions.py +0 -0
  78. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/persistence/dynamodb/keys.py +0 -0
  79. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/persistence/dynamodb/materialized_views.py +0 -0
  80. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/persistence/dynamodb/stream_fields.py +0 -0
  81. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/py.typed +0 -0
  82. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/request.py +0 -0
  83. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/resolver.py +0 -0
  84. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/response.py +0 -0
  85. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/routing.py +0 -0
  86. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/shared/__init__.py +0 -0
  87. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/shared/cookies.py +0 -0
  88. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/shared/headers_serializer.py +0 -0
  89. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/shared/json_encoder.py +0 -0
  90. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/shared/types.py +0 -0
  91. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/__init__.py +0 -0
  92. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/events/__init__.py +0 -0
  93. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/events/dynamodb.py +0 -0
  94. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/events/kinesis.py +0 -0
  95. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/events/s3.py +0 -0
  96. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/events/sns.py +0 -0
  97. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/events/sqs.py +0 -0
  98. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/filters/__init__.py +0 -0
  99. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/filters/content.py +0 -0
  100. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/filters/event_type.py +0 -0
  101. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/filters/latch.py +0 -0
  102. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/filters/skip.py +0 -0
  103. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/flavors/__init__.py +0 -0
  104. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/flavors/base_flavor.py +0 -0
  105. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/flavors/cdc.py +0 -0
  106. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/flavors/collect.py +0 -0
  107. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/flavors/correlate.py +0 -0
  108. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/flavors/evaluate.py +0 -0
  109. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/flavors/expired.py +0 -0
  110. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/flavors/iflavor.py +0 -0
  111. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/flavors/job.py +0 -0
  112. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/flavors/materialize.py +0 -0
  113. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/flavors/s3.py +0 -0
  114. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/flavors/sns.py +0 -0
  115. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/flavors/task.py +0 -0
  116. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/flavors/update.py +0 -0
  117. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/irules_registry.py +0 -0
  118. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/operators/__init__.py +0 -0
  119. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/operators/cloudwatch.py +0 -0
  120. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/operators/dynamodb.py +0 -0
  121. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/operators/ioperator.py +0 -0
  122. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/operators/lambda_.py +0 -0
  123. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/operators/publisher.py +0 -0
  124. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/operators/s3.py +0 -0
  125. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/operators/sns.py +0 -0
  126. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/operators/sqs.py +0 -0
  127. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/rules_registry.py +0 -0
  128. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/sources/__init__.py +0 -0
  129. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/__init__.py +0 -0
  130. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/apigateway.py +0 -0
  131. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/aws.py +0 -0
  132. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/batch.py +0 -0
  133. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/cloudwatch.py +0 -0
  134. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/concurrency.py +0 -0
  135. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/contracts.py +0 -0
  136. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/data_classes/__init__.py +0 -0
  137. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/data_classes/dynamodb.py +0 -0
  138. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/decorators.py +0 -0
  139. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/dynamodb.py +0 -0
  140. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/eventbridge.py +0 -0
  141. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/filters.py +0 -0
  142. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/json_encoder.py +0 -0
  143. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/lambda_.py +0 -0
  144. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/operators.py +0 -0
  145. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/pluralize.py +0 -0
  146. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/print.py +0 -0
  147. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/retry.py +0 -0
  148. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/s3.py +0 -0
  149. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/sns.py +0 -0
  150. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/split.py +0 -0
  151. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/sqs.py +0 -0
  152. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/tags.py +0 -0
  153. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/time.py +0 -0
  154. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/stream/utils/uow.py +0 -0
  155. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/tracing.py +0 -0
  156. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/modmex_lambda/validation.py +0 -0
  157. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/__init__.py +0 -0
  158. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/conftest.py +0 -0
  159. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/connectors/__init__.py +0 -0
  160. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/connectors/conftest.py +0 -0
  161. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/connectors/test_cloudwatch.py +0 -0
  162. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/connectors/test_dynamodb.py +0 -0
  163. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/connectors/test_lazy_clients.py +0 -0
  164. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/connectors/test_s3.py +0 -0
  165. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/connectors/test_simple_connectors.py +0 -0
  166. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/connectors/test_sns.py +0 -0
  167. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/connectors/test_sqs.py +0 -0
  168. {modmex_lambda-0.5.10/tests/event_handler → modmex_lambda-0.5.12/tests/data_classes}/__init__.py +0 -0
  169. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/data_classes/test_api_gateway_proxy_event.py +0 -0
  170. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/data_classes/test_cognito_user_pool_event.py +0 -0
  171. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/data_classes/test_common.py +0 -0
  172. {modmex_lambda-0.5.10/tests/stream → modmex_lambda-0.5.12/tests/event_handler}/__init__.py +0 -0
  173. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/event_handler/test_api_gateway.py +0 -0
  174. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/event_handler/test_cors.py +0 -0
  175. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/event_handler/test_exception_handler.py +0 -0
  176. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/event_handler/test_gateway_response.py +0 -0
  177. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/event_handler/test_request.py +0 -0
  178. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/event_handler/test_response.py +0 -0
  179. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/event_handler/test_routing.py +0 -0
  180. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/persistence/__init__.py +0 -0
  181. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/persistence/test_dynamodb_expressions.py +0 -0
  182. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/persistence/test_dynamodb_keys.py +0 -0
  183. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/persistence/test_dynamodb_materialized_views.py +0 -0
  184. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/persistence/test_dynamodb_stream_fields.py +0 -0
  185. {modmex_lambda-0.5.10/tests/stream/filters → modmex_lambda-0.5.12/tests/shared}/__init__.py +0 -0
  186. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/shared/test_cookies_headers.py +0 -0
  187. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/shared/test_json_encoder.py +0 -0
  188. {modmex_lambda-0.5.10/tests/stream/flavors → modmex_lambda-0.5.12/tests/stream}/__init__.py +0 -0
  189. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/conftest.py +0 -0
  190. {modmex_lambda-0.5.10/tests/stream/utils → modmex_lambda-0.5.12/tests/stream/events}/__init__.py +0 -0
  191. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/events/test_dynamodb.py +0 -0
  192. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/events/test_kinesis.py +0 -0
  193. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/events/test_s3.py +0 -0
  194. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/events/test_sns.py +0 -0
  195. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/events/test_sqs.py +0 -0
  196. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/filters/test_content.py +0 -0
  197. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/filters/test_event_type.py +0 -0
  198. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/filters/test_latch.py +0 -0
  199. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/filters/test_skip.py +0 -0
  200. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/flavors/source_events.py +0 -0
  201. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/flavors/test_base_flavor.py +0 -0
  202. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/flavors/test_cdc.py +0 -0
  203. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/flavors/test_collect.py +0 -0
  204. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/flavors/test_correlate.py +0 -0
  205. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/flavors/test_evaluate.py +0 -0
  206. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/flavors/test_expired.py +0 -0
  207. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/flavors/test_job.py +0 -0
  208. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/flavors/test_materialize.py +0 -0
  209. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/flavors/test_s3.py +0 -0
  210. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/flavors/test_sns.py +0 -0
  211. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/flavors/test_task.py +0 -0
  212. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/flavors/test_update.py +0 -0
  213. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/test_dependency_resolver.py +0 -0
  214. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/test_rules_registry.py +0 -0
  215. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/test_runner.py +0 -0
  216. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/test_runner_pipeline.py +0 -0
  217. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/test_sources.py +0 -0
  218. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/faults.py +0 -0
  219. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_apigateway.py +0 -0
  220. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_aws.py +0 -0
  221. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_batch.py +0 -0
  222. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_cloudwatch.py +0 -0
  223. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_concurrency.py +0 -0
  224. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_decorators.py +0 -0
  225. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_dynamodb.py +0 -0
  226. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_eventbridge.py +0 -0
  227. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_filters.py +0 -0
  228. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_json_encoder.py +0 -0
  229. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_lambda.py +0 -0
  230. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_operators.py +0 -0
  231. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_pluralize.py +0 -0
  232. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_print.py +0 -0
  233. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_retry.py +0 -0
  234. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_s3.py +0 -0
  235. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_sns.py +0 -0
  236. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_split.py +0 -0
  237. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_sqs.py +0 -0
  238. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_tags.py +0 -0
  239. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_time.py +0 -0
  240. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/stream/utils/test_uow.py +0 -0
  241. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/test_lazy_imports.py +0 -0
  242. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/test_logging.py +0 -0
  243. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/test_parser_event_sources.py +0 -0
  244. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/test_reexports.py +0 -0
  245. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/test_tracing.py +0 -0
  246. {modmex_lambda-0.5.10 → modmex_lambda-0.5.12}/tests/test_validation.py +0 -0
@@ -220,4 +220,8 @@ __marimo__/
220
220
  .vscode/
221
221
  .doc/
222
222
 
223
- .DS_Store
223
+ .DS_Store
224
+
225
+ */.serverless
226
+
227
+ .examples
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modmex-lambda
3
- Version: 0.5.10
3
+ Version: 0.5.12
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.1.12
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
@@ -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, Generic[T]):
11
+ class Param(BaseModel):
16
12
  name: str | None = None
17
13
 
18
14
 
19
- class Body(Param[T]):
15
+ class Body(Param):
20
16
  pass
21
17
 
22
18
 
23
- class Query(Param[T]):
19
+ class Query(Param):
24
20
  pass
25
21
 
26
22
 
27
- class Path(Param[T]):
23
+ class Path(Param):
28
24
  pass
29
25
 
30
26
 
31
- class Header(Param[T]):
27
+ class Header(Param):
32
28
  pass
33
29
 
34
30
 
35
- class Cookie(Param[T]):
31
+ class Cookie(Param):
36
32
  pass
37
33
 
38
34
 
39
- class RawEvent(Param[T]):
35
+ class RawEvent(Param):
40
36
  pass
41
37
 
42
38
 
43
- class LambdaContext(Param[T]):
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 contextvars import Token
6
+ from typing import Any, Callable, Iterable, TypedDict
7
+
8
+ from reactivex import Observable, from_list, operators as ops
9
+
10
+ from modmex_lambda.stream.irules_registry import IRulesRegistry
11
+ from modmex_lambda.stream.schedulers import ContextThreadPoolScheduler
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 = ContextThreadPoolScheduler(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)
@@ -0,0 +1,15 @@
1
+ from contextvars import copy_context
2
+
3
+ from reactivex.scheduler import ThreadPoolScheduler
4
+
5
+
6
+ class ContextThreadPoolScheduler(ThreadPoolScheduler):
7
+ """Thread-pool scheduler that preserves the scheduling context."""
8
+
9
+ class ThreadPoolThread(ThreadPoolScheduler.ThreadPoolThread):
10
+ def __init__(self, executor, target):
11
+ super().__init__(executor, target)
12
+ self.context = copy_context()
13
+
14
+ def start(self) -> None:
15
+ self.future = self.executor.submit(self.context.run, self.target)
@@ -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