documente_shared 0.1.7__py3-none-any.whl → 0.1.9__py3-none-any.whl

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.

Potentially problematic release.


This version of documente_shared might be problematic. Click here for more details.

@@ -7,6 +7,8 @@ from dataclasses import dataclass
7
7
  @dataclass
8
8
  class SQSQueue(object):
9
9
  queue_url: str
10
+ visibility_timeout: int = 60 * 10
11
+ waiting_timeout: int = 20
10
12
 
11
13
  def __post_init__(self):
12
14
  self._client = boto3.client('sqs')
@@ -35,3 +37,12 @@ class SQSQueue(object):
35
37
  QueueUrl=self.queue_url,
36
38
  ReceiptHandle=receipt_handle
37
39
  )
40
+
41
+ def fetch_messages(self, num_messages: int = 1) -> list[dict]:
42
+ response = self._client.receive_message(
43
+ QueueUrl=self.queue_url,
44
+ MaxNumberOfMessages=num_messages,
45
+ VisibilityTimeout=self.visibility_timeout,
46
+ WaitTimeSeconds=self.waiting_timeout,
47
+ )
48
+ return response.get('Messages', [])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: documente_shared
3
- Version: 0.1.7
3
+ Version: 0.1.9
4
4
  Summary: Shared utilities for Documente AI projects
5
5
  License: MIT
6
6
  Author: Tech
@@ -8,7 +8,7 @@ documente_shared/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
8
8
  documente_shared/infrastructure/dynamo_repositories.py,sha256=9t_ufQBSF7cJbeHYzfJABOQydj1HAvhI8UnqDEDPryA,532
9
9
  documente_shared/infrastructure/dynamo_table.py,sha256=5yF5EVQkHTZe4tLYZsfEDS8tp_iorMlMjNu-qn3Oj9E,2095
10
10
  documente_shared/infrastructure/s3_bucket.py,sha256=yL1mjwwlj8R72t38OAKg-VzkWqV2NOR7XQl17GxTb8A,1566
11
- documente_shared/infrastructure/sqs_queue.py,sha256=Eui3-8ZuTmlRkaSlAugH-XaB1DZmjEOz4fq72WDKum8,1078
12
- documente_shared-0.1.7.dist-info/METADATA,sha256=IaWQ43TrtDAKlpledxdYtud5FoW5BK5HhcEJf4GlZ40,639
13
- documente_shared-0.1.7.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
14
- documente_shared-0.1.7.dist-info/RECORD,,
11
+ documente_shared/infrastructure/sqs_queue.py,sha256=PSiTAnjXvQ-W-9mzLpH2UjbQJTvYkMiaxNaMecF-cR4,1505
12
+ documente_shared-0.1.9.dist-info/METADATA,sha256=A6YNVsxdYTrJvy24hWuQtH8drHMKgEQOeUqznOSBchA,639
13
+ documente_shared-0.1.9.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
14
+ documente_shared-0.1.9.dist-info/RECORD,,