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.
- {weenspace_queue-0.1.1 → weenspace_queue-0.1.2}/PKG-INFO +1 -1
- {weenspace_queue-0.1.1 → weenspace_queue-0.1.2}/pyproject.toml +1 -1
- {weenspace_queue-0.1.1 → weenspace_queue-0.1.2}/weenspace_queue/__init__.py +16 -0
- weenspace_queue-0.1.2/weenspace_queue/asyncio/__init__.py +23 -0
- {weenspace_queue-0.1.1 → weenspace_queue-0.1.2}/weenspace_queue/asyncio/rabbitmq_async.py +4 -4
- weenspace_queue-0.1.2/weenspace_queue/providers/__init__.py +15 -0
- {weenspace_queue-0.1.1 → weenspace_queue-0.1.2}/weenspace_queue/providers/rabbitmq.py +4 -4
- weenspace_queue-0.1.2/weenspace_queue/ssl_configuration.py +3 -0
- {weenspace_queue-0.1.1 → weenspace_queue-0.1.2}/weenspace_queue/utils.py +8 -0
- weenspace_queue-0.1.1/weenspace_queue/asyncio/__init__.py +0 -4
- weenspace_queue-0.1.1/weenspace_queue/providers/__init__.py +0 -4
- {weenspace_queue-0.1.1 → weenspace_queue-0.1.2}/LICENSE +0 -0
- {weenspace_queue-0.1.1 → weenspace_queue-0.1.2}/README.md +0 -0
- {weenspace_queue-0.1.1 → weenspace_queue-0.1.2}/weenspace_queue/asyncio/aws_async.py +0 -0
- {weenspace_queue-0.1.1 → weenspace_queue-0.1.2}/weenspace_queue/base.py +0 -0
- {weenspace_queue-0.1.1 → weenspace_queue-0.1.2}/weenspace_queue/constants.py +0 -0
- {weenspace_queue-0.1.1 → weenspace_queue-0.1.2}/weenspace_queue/providers/aws.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "weenspace-queue"
|
|
3
|
-
version = "0.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.
|
|
39
|
-
ExchangeKind.TOPIC: ExchangeType.
|
|
40
|
-
ExchangeKind.FANOUT: ExchangeType.
|
|
41
|
-
ExchangeKind.HEADERS: ExchangeType.
|
|
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.
|
|
34
|
-
ExchangeKind.TOPIC: ExchangeType.
|
|
35
|
-
ExchangeKind.FANOUT: ExchangeType.
|
|
36
|
-
ExchangeKind.HEADERS: ExchangeType.
|
|
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
|
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|