async-lambda-unstable 0.6.9__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.
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/PKG-INFO +1 -1
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/__init__.py +1 -1
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/controller.py +19 -1
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/mock/mock_event.py +3 -2
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/.gitignore +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/README.md +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/build_config.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/cli.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/client.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/config.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/defer.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/env.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/middleware.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/__init__.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/api_response.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/case_insensitive_dict.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/events/__init__.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/events/api_event.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/events/base_event.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/events/dynamodb_event.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/events/managed_sqs_batch_event.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/events/managed_sqs_event.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/events/scheduled_event.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/events/unmanaged_sqs_event.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/mock/mock_context.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/task.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/payload_encoder.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/py.typed +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/util.py +0 -0
- {async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/pyproject.toml +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.
|
|
24
|
+
__version__ = "0.6.11"
|
|
@@ -431,6 +431,12 @@ class AsyncLambdaController:
|
|
|
431
431
|
"ASYNC_LAMBDA_DELAY_SCHEDULE_GROUP": {
|
|
432
432
|
"Ref": "AsyncLambdaDelayScheduleGroup"
|
|
433
433
|
},
|
|
434
|
+
"ASYNC_LAMBDA_DELAY_SCHEDULE_DLQ_ARN": {
|
|
435
|
+
"Fn::GetAtt": [
|
|
436
|
+
"AsyncLambdaDelayDLQ",
|
|
437
|
+
"Arn",
|
|
438
|
+
]
|
|
439
|
+
},
|
|
434
440
|
**build_config.environment_variables,
|
|
435
441
|
},
|
|
436
442
|
},
|
|
@@ -1036,12 +1042,24 @@ class AsyncLambdaController:
|
|
|
1036
1042
|
delay (int): Delay in seconds before delivering the message.
|
|
1037
1043
|
message_group_id (Optional[str]): MessageGroupId for FIFO queues. Defaults to None.
|
|
1038
1044
|
"""
|
|
1039
|
-
|
|
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
|
+
)
|
|
1040
1057
|
schedule_expression = f"at({schedule_time.strftime('%Y-%m-%dT%H:%M:%S')})"
|
|
1041
1058
|
|
|
1042
1059
|
sqs_input: dict = {
|
|
1043
1060
|
"QueueUrl": queue_url,
|
|
1044
1061
|
"MessageBody": message_body,
|
|
1062
|
+
"DelaySeconds": _SQS_MAX_DELAY_SECONDS,
|
|
1045
1063
|
}
|
|
1046
1064
|
if message_group_id:
|
|
1047
1065
|
sqs_input["MessageGroupId"] = message_group_id
|
{async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/mock/mock_event.py
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from time import time
|
|
2
2
|
from typing import List, Optional, Tuple
|
|
3
3
|
from urllib.parse import parse_qs, parse_qsl
|
|
4
|
+
from uuid import uuid4
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
def MockSQSLambdaEvent(
|
|
@@ -27,7 +28,7 @@ def MockSQSLambdaEvent(
|
|
|
27
28
|
return {
|
|
28
29
|
"Records": [
|
|
29
30
|
{
|
|
30
|
-
"messageId":
|
|
31
|
+
"messageId": str(uuid4()),
|
|
31
32
|
"receiptHandle": "AQEBwJnKyrHigUMZj6rYigCgxlaS3SLy0a",
|
|
32
33
|
"body": body,
|
|
33
34
|
"attributes": {
|
|
@@ -107,7 +108,7 @@ def MockSQSBatchLambdaEvent(
|
|
|
107
108
|
for body in bodies:
|
|
108
109
|
records.append(
|
|
109
110
|
{
|
|
110
|
-
"messageId":
|
|
111
|
+
"messageId": str(uuid4()),
|
|
111
112
|
"receiptHandle": "AQEBwJnKyrHigUMZj6rYigCgxlaS3SLy0b",
|
|
112
113
|
"body": body,
|
|
113
114
|
"attributes": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/__init__.py
RENAMED
|
File without changes
|
{async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/api_response.py
RENAMED
|
File without changes
|
|
File without changes
|
{async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/events/__init__.py
RENAMED
|
File without changes
|
{async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/models/events/api_event.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{async_lambda_unstable-0.6.9 → async_lambda_unstable-0.6.11}/async_lambda/payload_encoder.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|