async-lambda-unstable 0.6.10__tar.gz → 0.6.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.
Files changed (30) hide show
  1. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/PKG-INFO +1 -1
  2. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/__init__.py +1 -1
  3. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/controller.py +13 -1
  4. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/.gitignore +0 -0
  5. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/README.md +0 -0
  6. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/build_config.py +0 -0
  7. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/cli.py +0 -0
  8. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/client.py +0 -0
  9. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/config.py +0 -0
  10. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/defer.py +0 -0
  11. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/env.py +0 -0
  12. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/middleware.py +0 -0
  13. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/models/__init__.py +0 -0
  14. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/models/api_response.py +0 -0
  15. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/models/case_insensitive_dict.py +0 -0
  16. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/models/events/__init__.py +0 -0
  17. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/models/events/api_event.py +0 -0
  18. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/models/events/base_event.py +0 -0
  19. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/models/events/dynamodb_event.py +0 -0
  20. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/models/events/managed_sqs_batch_event.py +0 -0
  21. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/models/events/managed_sqs_event.py +0 -0
  22. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/models/events/scheduled_event.py +0 -0
  23. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/models/events/unmanaged_sqs_event.py +0 -0
  24. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/models/mock/mock_context.py +0 -0
  25. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/models/mock/mock_event.py +0 -0
  26. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/models/task.py +0 -0
  27. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/payload_encoder.py +0 -0
  28. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/py.typed +0 -0
  29. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/async_lambda/util.py +0 -0
  30. {async_lambda_unstable-0.6.10 → async_lambda_unstable-0.6.11}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: async-lambda-unstable
3
- Version: 0.6.10
3
+ Version: 0.6.11
4
4
  Summary: A framework for creating AWS Lambda Async Workflows. - Unstable Branch
5
5
  Author-email: "Nuclei, Inc" <engineering@nuclei.ai>
6
6
  Requires-Dist: click>=8.0.0
@@ -21,4 +21,4 @@ from .models.events.managed_sqs_event import ManagedSQSEvent as ManagedSQSEvent
21
21
  from .models.events.scheduled_event import ScheduledEvent as ScheduledEvent
22
22
  from .models.events.unmanaged_sqs_event import UnmanagedSQSEvent as UnmanagedSQSEvent
23
23
 
24
- __version__ = "0.6.10"
24
+ __version__ = "0.6.11"
@@ -1042,12 +1042,24 @@ class AsyncLambdaController:
1042
1042
  delay (int): Delay in seconds before delivering the message.
1043
1043
  message_group_id (Optional[str]): MessageGroupId for FIFO queues. Defaults to None.
1044
1044
  """
1045
- schedule_time = datetime.now(tz=timezone.utc) + timedelta(seconds=delay)
1045
+ if delay <= _SQS_MAX_DELAY_SECONDS:
1046
+ raise ValueError(
1047
+ f"Delays with EventBridge Scheduler must be greater than {_SQS_MAX_DELAY_SECONDS} seconds. Use SQS delay instead."
1048
+ )
1049
+
1050
+ # Schedule names are unique and ActionAfterCompletion="DELETE" is an asynchronous action. This can take a few
1051
+ # seconds, during which time, re-scheduling yourself on the same schedule_name would fail. Utilizing full
1052
+ # _SQS_MAX_DELAY_SECONDS as a buffer in case AWS ActionAfterCompletion becomes delayed.
1053
+ scheduler_delay = delay - _SQS_MAX_DELAY_SECONDS
1054
+ schedule_time = datetime.now(tz=timezone.utc) + timedelta(
1055
+ seconds=scheduler_delay
1056
+ )
1046
1057
  schedule_expression = f"at({schedule_time.strftime('%Y-%m-%dT%H:%M:%S')})"
1047
1058
 
1048
1059
  sqs_input: dict = {
1049
1060
  "QueueUrl": queue_url,
1050
1061
  "MessageBody": message_body,
1062
+ "DelaySeconds": _SQS_MAX_DELAY_SECONDS,
1051
1063
  }
1052
1064
  if message_group_id:
1053
1065
  sqs_input["MessageGroupId"] = message_group_id