weenspace-queue 0.1.1__tar.gz → 0.1.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: weenspace-queue
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: WeenSpace queue client for RabbitMQ and AWS SQS, supporting both synchronous and asynchronous operations.
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "weenspace-queue"
3
- version = "0.1.1"
3
+ version = "0.1.2"
4
4
  description = "WeenSpace queue client for RabbitMQ and AWS SQS, supporting both synchronous and asynchronous operations."
5
5
  authors = ["WeenSpace <weenspace@gmail.com>"]
6
6
  license = "MIT"
@@ -15,6 +15,22 @@ from .constants import (
15
15
  )
16
16
 
17
17
 
18
+ def __getattr__(name: str) -> Any:
19
+ """Lazily expose the low-level RabbitMQ compatibility API."""
20
+ try:
21
+ from rabbitmq_amqp_python_client import __dict__ as rabbitmq_namespace
22
+
23
+ value = rabbitmq_namespace.get(name)
24
+ if value is None and name == "DirectReplyToConsumerOptions":
25
+ value = rabbitmq_namespace["ConsumerOptions"]
26
+ if value is None:
27
+ raise KeyError(name)
28
+ except (ImportError, KeyError) as exc:
29
+ raise AttributeError(name) from exc
30
+ globals()[name] = value
31
+ return value
32
+
33
+
18
34
  def _engine_class(provider: str) -> Type[QueueEngine]:
19
35
  if provider == PROVIDER_AWS:
20
36
  from .providers.aws import AwsEngine
@@ -0,0 +1,23 @@
1
+ from typing import Any
2
+
3
+ __all__ = ["AwsAsyncEngine", "RabbitMqAsyncEngine"]
4
+
5
+
6
+ def __getattr__(name: str) -> Any:
7
+ try:
8
+ from rabbitmq_amqp_python_client.asyncio import __dict__ as rabbitmq_namespace
9
+
10
+ value = rabbitmq_namespace[name]
11
+ globals()[name] = value
12
+ return value
13
+ except (ImportError, KeyError):
14
+ pass
15
+ if name == "AwsAsyncEngine":
16
+ from .aws_async import AwsAsyncEngine
17
+
18
+ return AwsAsyncEngine
19
+ if name == "RabbitMqAsyncEngine":
20
+ from .rabbitmq_async import RabbitMqAsyncEngine
21
+
22
+ return RabbitMqAsyncEngine
23
+ raise AttributeError(name)
@@ -35,10 +35,10 @@ from weenspace_queue.utils import (
35
35
  )
36
36
 
37
37
  _EXCHANGE_KIND_MAP = {
38
- ExchangeKind.DIRECT: ExchangeType.DIRECT,
39
- ExchangeKind.TOPIC: ExchangeType.TOPIC,
40
- ExchangeKind.FANOUT: ExchangeType.FANOUT,
41
- ExchangeKind.HEADERS: ExchangeType.HEADERS,
38
+ ExchangeKind.DIRECT: ExchangeType.direct,
39
+ ExchangeKind.TOPIC: ExchangeType.topic,
40
+ ExchangeKind.FANOUT: ExchangeType.fanout,
41
+ ExchangeKind.HEADERS: ExchangeType.headers,
42
42
  }
43
43
 
44
44
 
@@ -0,0 +1,15 @@
1
+ from typing import Any
2
+
3
+ __all__ = ["AwsEngine", "RabbitMqEngine"]
4
+
5
+
6
+ def __getattr__(name: str) -> Any:
7
+ if name == "AwsEngine":
8
+ from .aws import AwsEngine
9
+
10
+ return AwsEngine
11
+ if name == "RabbitMqEngine":
12
+ from .rabbitmq import RabbitMqEngine
13
+
14
+ return RabbitMqEngine
15
+ raise AttributeError(name)
@@ -30,10 +30,10 @@ from weenspace_queue.utils import (
30
30
  )
31
31
 
32
32
  _EXCHANGE_KIND_MAP = {
33
- ExchangeKind.DIRECT: ExchangeType.DIRECT,
34
- ExchangeKind.TOPIC: ExchangeType.TOPIC,
35
- ExchangeKind.FANOUT: ExchangeType.FANOUT,
36
- ExchangeKind.HEADERS: ExchangeType.HEADERS,
33
+ ExchangeKind.DIRECT: ExchangeType.direct,
34
+ ExchangeKind.TOPIC: ExchangeType.topic,
35
+ ExchangeKind.FANOUT: ExchangeType.fanout,
36
+ ExchangeKind.HEADERS: ExchangeType.headers,
37
37
  }
38
38
 
39
39
 
@@ -0,0 +1,3 @@
1
+ """Compatibility exports for the RabbitMQ TLS configuration API."""
2
+
3
+ from rabbitmq_amqp_python_client.ssl_configuration import * # noqa: F401,F403
@@ -24,6 +24,14 @@ from .constants import (
24
24
  )
25
25
 
26
26
 
27
+ def __getattr__(name: str) -> Any:
28
+ if name == "Converter":
29
+ from rabbitmq_amqp_python_client.utils import Converter
30
+
31
+ return Converter
32
+ raise AttributeError(name)
33
+
34
+
27
35
  def encode_body(body: Any) -> bytes:
28
36
  if isinstance(body, bytes):
29
37
  return body
@@ -1,4 +0,0 @@
1
- from .aws_async import AwsAsyncEngine
2
- from .rabbitmq_async import RabbitMqAsyncEngine
3
-
4
- __all__ = ["AwsAsyncEngine", "RabbitMqAsyncEngine"]
@@ -1,4 +0,0 @@
1
- from .aws import AwsEngine
2
- from .rabbitmq import RabbitMqEngine
3
-
4
- __all__ = ["AwsEngine", "RabbitMqEngine"]
File without changes