async-lambda-unstable 0.2.8__tar.gz → 0.2.9__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 (27) hide show
  1. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/PKG-INFO +1 -1
  2. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda/__init__.py +1 -1
  3. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda/controller.py +8 -5
  4. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda/models/events/managed_sqs_event.py +3 -0
  5. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda/models/events/unmanaged_sqs_event.py +3 -0
  6. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda_unstable.egg-info/PKG-INFO +1 -1
  7. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/README.md +0 -0
  8. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda/build_config.py +0 -0
  9. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda/cli.py +0 -0
  10. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda/config.py +0 -0
  11. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda/env.py +0 -0
  12. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda/models/__init__.py +0 -0
  13. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda/models/events/__init__.py +0 -0
  14. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda/models/events/api_event.py +0 -0
  15. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda/models/events/base_event.py +0 -0
  16. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda/models/events/scheduled_event.py +0 -0
  17. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda/models/mock/mock_context.py +0 -0
  18. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda/models/mock/mock_event.py +0 -0
  19. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda/models/task.py +0 -0
  20. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda/py.typed +0 -0
  21. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda_unstable.egg-info/SOURCES.txt +0 -0
  22. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda_unstable.egg-info/dependency_links.txt +0 -0
  23. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda_unstable.egg-info/entry_points.txt +0 -0
  24. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda_unstable.egg-info/requires.txt +0 -0
  25. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/async_lambda_unstable.egg-info/top_level.txt +0 -0
  26. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/pyproject.toml +0 -0
  27. {async-lambda-unstable-0.2.8 → async-lambda-unstable-0.2.9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: async-lambda-unstable
3
- Version: 0.2.8
3
+ Version: 0.2.9
4
4
  Summary: A framework for creating AWS Lambda Async Workflows. - Unstable Branch
5
5
  Author-email: "Nuclei, Inc" <engineering@nuclei.ai>
6
6
  Description-Content-Type: text/markdown
@@ -9,4 +9,4 @@ from .models.events.managed_sqs_event import ManagedSQSEvent as ManagedSQSEvent
9
9
  from .models.events.scheduled_event import ScheduledEvent as ScheduledEvent
10
10
  from .models.events.unmanaged_sqs_event import UnmanagedSQSEvent as UnmanagedSQSEvent
11
11
 
12
- __version__ = "0.2.8"
12
+ __version__ = "0.2.9"
@@ -1,6 +1,7 @@
1
1
  import functools
2
2
  import json
3
3
  import logging
4
+ import time
4
5
  from typing import Any, Callable, Dict, Optional
5
6
  from uuid import uuid4
6
7
 
@@ -168,9 +169,11 @@ class AsyncLambdaController:
168
169
  }
169
170
  )
170
171
  logger.info(
171
- f"Invoking task '{destination_task.task_id}' - invocation_id '{invocation_id}'"
172
+ f"Invoking task '{destination_task.task_id}' - invocation_id '{invocation_id}' - delay {delay or 0}"
172
173
  )
173
174
  if force_sync or env.get_force_sync_mode():
175
+ if delay:
176
+ time.sleep(delay)
174
177
  # Sync invocation with mock event/context
175
178
  mock_event = MockLambdaEvent(sqs_payload)
176
179
  mock_context = MockLambdaContext(destination_task.task_id)
@@ -233,7 +236,7 @@ class AsyncLambdaController:
233
236
  )
234
237
  )
235
238
 
236
- @functools.wraps
239
+ @functools.wraps(func)
237
240
  def inner(*args, **kwargs):
238
241
  self.set_current_task_id(task_id)
239
242
  return func(*args, **kwargs)
@@ -262,7 +265,7 @@ class AsyncLambdaController:
262
265
  )
263
266
  )
264
267
 
265
- @functools.wraps
268
+ @functools.wraps(func)
266
269
  def inner(*args, **kwargs):
267
270
  self.set_current_task_id(task_id)
268
271
  return func(*args, **kwargs)
@@ -291,7 +294,7 @@ class AsyncLambdaController:
291
294
  )
292
295
  )
293
296
 
294
- @functools.wraps
297
+ @functools.wraps(func)
295
298
  def inner(*args, **kwargs):
296
299
  self.set_current_task_id(task_id)
297
300
  return func(*args, **kwargs)
@@ -320,7 +323,7 @@ class AsyncLambdaController:
320
323
  )
321
324
  )
322
325
 
323
- @functools.wraps
326
+ @functools.wraps(func)
324
327
  def inner(*args, **kwargs):
325
328
  self.set_current_task_id(task_id)
326
329
  return func(*args, **kwargs)
@@ -52,3 +52,6 @@ class ManagedSQSEvent(BaseEvent):
52
52
  return
53
53
 
54
54
  raise NotImplementedError("S3 Payload Retrieval is not implemented.")
55
+
56
+ def __str__(self):
57
+ return json.dumps(self.payload)
@@ -36,3 +36,6 @@ class UnmanagedSQSEvent(BaseEvent):
36
36
  Returns the JSON parsed body of the event.
37
37
  """
38
38
  return json.loads(self.body)
39
+
40
+ def __str__(self):
41
+ return self.body
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: async-lambda-unstable
3
- Version: 0.2.8
3
+ Version: 0.2.9
4
4
  Summary: A framework for creating AWS Lambda Async Workflows. - Unstable Branch
5
5
  Author-email: "Nuclei, Inc" <engineering@nuclei.ai>
6
6
  Description-Content-Type: text/markdown