async-lambda-unstable 0.6.4__tar.gz → 0.6.6__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.4 → async_lambda_unstable-0.6.6}/PKG-INFO +1 -1
  2. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/__init__.py +1 -1
  3. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/controller.py +4 -1
  4. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/models/task.py +9 -0
  5. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/.gitignore +0 -0
  6. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/README.md +0 -0
  7. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/build_config.py +0 -0
  8. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/cli.py +0 -0
  9. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/client.py +0 -0
  10. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/config.py +0 -0
  11. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/defer.py +0 -0
  12. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/env.py +0 -0
  13. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/middleware.py +0 -0
  14. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/models/__init__.py +0 -0
  15. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/models/api_response.py +0 -0
  16. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/models/case_insensitive_dict.py +0 -0
  17. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/models/events/__init__.py +0 -0
  18. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/models/events/api_event.py +0 -0
  19. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/models/events/base_event.py +0 -0
  20. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/models/events/dynamodb_event.py +0 -0
  21. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/models/events/managed_sqs_batch_event.py +0 -0
  22. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/models/events/managed_sqs_event.py +0 -0
  23. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/models/events/scheduled_event.py +0 -0
  24. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/models/events/unmanaged_sqs_event.py +0 -0
  25. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/models/mock/mock_context.py +0 -0
  26. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/models/mock/mock_event.py +0 -0
  27. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/payload_encoder.py +0 -0
  28. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/py.typed +0 -0
  29. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/async_lambda/util.py +0 -0
  30. {async_lambda_unstable-0.6.4 → async_lambda_unstable-0.6.6}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: async-lambda-unstable
3
- Version: 0.6.4
3
+ Version: 0.6.6
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.4"
24
+ __version__ = "0.6.6"
@@ -426,7 +426,6 @@ class AsyncLambdaController:
426
426
  **build_config.environment_variables,
427
427
  },
428
428
  },
429
- "CodeUri": ".async_lambda/build/deployment.zip",
430
429
  "MemorySize": config.default_task_memory,
431
430
  "EphemeralStorage": {"Size": config.default_task_ephemeral_storage},
432
431
  **build_config.function_properties,
@@ -1278,6 +1277,7 @@ class AsyncLambdaController:
1278
1277
  timeout: int = 60,
1279
1278
  memory: Optional[int] = None,
1280
1279
  ephemeral_storage: Optional[int] = None,
1280
+ snap_start: bool = False,
1281
1281
  **kwargs,
1282
1282
  ):
1283
1283
  """
@@ -1335,6 +1335,7 @@ class AsyncLambdaController:
1335
1335
  timeout=timeout,
1336
1336
  memory=memory,
1337
1337
  ephemeral_storage=ephemeral_storage,
1338
+ snap_start=snap_start,
1338
1339
  **kwargs,
1339
1340
  )
1340
1341
  )
@@ -1548,6 +1549,7 @@ class AsyncLambdaController:
1548
1549
  timeout: int = 60,
1549
1550
  memory: Optional[int] = None,
1550
1551
  ephemeral_storage: Optional[int] = None,
1552
+ snap_start: bool = False,
1551
1553
  **kwargs,
1552
1554
  ):
1553
1555
  """
@@ -1595,6 +1597,7 @@ class AsyncLambdaController:
1595
1597
  timeout=timeout,
1596
1598
  memory=memory,
1597
1599
  ephemeral_storage=ephemeral_storage,
1600
+ snap_start=snap_start,
1598
1601
  **kwargs,
1599
1602
  )
1600
1603
  )
@@ -102,6 +102,7 @@ class AsyncLambdaTask(Generic[EventType, RT]):
102
102
  ephemeral_storage: Optional[int]
103
103
  maximum_concurrency: Optional[Union[int, List[int]]]
104
104
  init_tasks: List[Union[Callable[[str], Any], Callable[[], Any]]]
105
+ snap_start: bool
105
106
  _has_run_init_tasks: bool
106
107
 
107
108
  executable: Callable[[EventType], RT]
@@ -120,6 +121,7 @@ class AsyncLambdaTask(Generic[EventType, RT]):
120
121
  init_tasks: Optional[
121
122
  List[Union[Callable[[str], Any], Callable[[], Any]]]
122
123
  ] = None,
124
+ snap_start: bool = False,
123
125
  ):
124
126
  """
125
127
  Initialize an AsyncLambdaTask instance.
@@ -135,6 +137,7 @@ class AsyncLambdaTask(Generic[EventType, RT]):
135
137
  ephemeral_storage (Optional[int], optional): Ephemeral storage (MB). Defaults to None.
136
138
  maximum_concurrency (Optional[Union[int, List[int]]], optional): Maximum concurrency for the task. Defaults to None.
137
139
  init_tasks (Optional[List[Union[Callable[[str], Any], Callable[[], Any]]]], optional): Initialization tasks to run before execution. Defaults to None.
140
+ snap_start (bool): Enables SnapStart with static configuration. Defaults to False.
138
141
 
139
142
  Raises:
140
143
  Exception: If the DLQ (Dead Letter Queue) task ID is specified but does not exist or is not an async-task.
@@ -149,6 +152,7 @@ class AsyncLambdaTask(Generic[EventType, RT]):
149
152
  self.memory = memory
150
153
  self.ephemeral_storage = ephemeral_storage
151
154
  self.maximum_concurrency = maximum_concurrency
155
+ self.snap_start = snap_start
152
156
  if init_tasks is None:
153
157
  self.init_tasks = []
154
158
  else:
@@ -620,6 +624,7 @@ class AsyncLambdaTask(Generic[EventType, RT]):
620
624
  "Timeout": self.timeout,
621
625
  "Events": events,
622
626
  "Policies": policies,
627
+ "CodeUri": ".async_lambda/build/deployment.zip",
623
628
  **override_config.function_properties,
624
629
  },
625
630
  }
@@ -632,6 +637,10 @@ class AsyncLambdaTask(Generic[EventType, RT]):
632
637
  template[self.get_function_logical_id()]["Properties"][
633
638
  "EphemeralStorage"
634
639
  ] = {"Size": self.ephemeral_storage}
640
+ if self.snap_start:
641
+ template[self.get_function_logical_id()]["Properties"]["SnapStart"] = {
642
+ "ApplyOn": "PublishedVersions"
643
+ }
635
644
 
636
645
  if self.trigger_type in MANAGED_SQS_TASK_TYPES:
637
646
  dlq_task = self.get_dlq_task()