weenspace-queue 0.1.2__tar.gz → 0.1.4__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.2 → weenspace_queue-0.1.4}/PKG-INFO +10 -6
- {weenspace_queue-0.1.2 → weenspace_queue-0.1.4}/README.md +9 -5
- {weenspace_queue-0.1.2 → weenspace_queue-0.1.4}/pyproject.toml +1 -1
- {weenspace_queue-0.1.2 → weenspace_queue-0.1.4}/weenspace_queue/__init__.py +2 -2
- weenspace_queue-0.1.4/weenspace_queue/asyncio/publisher.py +3 -0
- weenspace_queue-0.1.4/weenspace_queue/connection.py +3 -0
- {weenspace_queue-0.1.2 → weenspace_queue-0.1.4}/weenspace_queue/constants.py +2 -2
- weenspace_queue-0.1.4/weenspace_queue/entities.py +3 -0
- weenspace_queue-0.1.4/weenspace_queue/exceptions.py +3 -0
- weenspace_queue-0.1.4/weenspace_queue/qpid/__init__.py +1 -0
- weenspace_queue-0.1.4/weenspace_queue/qpid/proton/__init__.py +3 -0
- {weenspace_queue-0.1.2 → weenspace_queue-0.1.4}/LICENSE +0 -0
- {weenspace_queue-0.1.2 → weenspace_queue-0.1.4}/weenspace_queue/asyncio/__init__.py +0 -0
- {weenspace_queue-0.1.2 → weenspace_queue-0.1.4}/weenspace_queue/asyncio/aws_async.py +0 -0
- {weenspace_queue-0.1.2 → weenspace_queue-0.1.4}/weenspace_queue/asyncio/rabbitmq_async.py +0 -0
- {weenspace_queue-0.1.2 → weenspace_queue-0.1.4}/weenspace_queue/base.py +0 -0
- {weenspace_queue-0.1.2 → weenspace_queue-0.1.4}/weenspace_queue/providers/__init__.py +0 -0
- {weenspace_queue-0.1.2 → weenspace_queue-0.1.4}/weenspace_queue/providers/aws.py +0 -0
- {weenspace_queue-0.1.2 → weenspace_queue-0.1.4}/weenspace_queue/providers/rabbitmq.py +0 -0
- {weenspace_queue-0.1.2 → weenspace_queue-0.1.4}/weenspace_queue/ssl_configuration.py +0 -0
- {weenspace_queue-0.1.2 → weenspace_queue-0.1.4}/weenspace_queue/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: weenspace-queue
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
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
|
|
@@ -58,7 +58,7 @@ pip install weenspace-queue
|
|
|
58
58
|
```python
|
|
59
59
|
from weenspace_queue import Message, QueueClient, QueueSpecification
|
|
60
60
|
|
|
61
|
-
client = QueueClient("
|
|
61
|
+
client = QueueClient("RABBITMQ", uri="amqp://guest:guest@localhost:5672/")
|
|
62
62
|
queue = client.declare_queue(QueueSpecification(name="my-queue"))
|
|
63
63
|
client.publish(queue, Message(body=b"Hello WeenSpace!"))
|
|
64
64
|
|
|
@@ -71,6 +71,10 @@ client.consume(queue, handler=on_message, prefetch=10)
|
|
|
71
71
|
|
|
72
72
|
Install AWS support with `pip install "weenspace-queue[aws]"`.
|
|
73
73
|
|
|
74
|
+
### AWS SQS and SNS
|
|
75
|
+
|
|
76
|
+
See [examples/aws/sqs.py](https://github.com/WeenSpace/weenspace-queue/blob/main/examples/aws/sqs.py) for direct SQS publishing and [examples/aws/sns.py](https://github.com/WeenSpace/weenspace-queue/blob/main/examples/aws/sns.py) for an SNS-to-SQS workflow with routing-key filters.
|
|
77
|
+
|
|
74
78
|
### Async Support
|
|
75
79
|
|
|
76
80
|
```python
|
|
@@ -78,7 +82,7 @@ import asyncio
|
|
|
78
82
|
from weenspace_queue import AsyncQueueClient, Message, QueueSpecification
|
|
79
83
|
|
|
80
84
|
async def main():
|
|
81
|
-
async with AsyncQueueClient("
|
|
85
|
+
async with AsyncQueueClient("RABBITMQ", uri="amqp://localhost:5672/") as client:
|
|
82
86
|
queue = await client.declare_queue(QueueSpecification(name="my-queue"))
|
|
83
87
|
await client.publish(queue, Message(body=b"Async message!"))
|
|
84
88
|
|
|
@@ -91,7 +95,7 @@ asyncio.run(main())
|
|
|
91
95
|
from weenspace_queue import QueueClient
|
|
92
96
|
|
|
93
97
|
client = QueueClient(
|
|
94
|
-
"
|
|
98
|
+
"RABBITMQ",
|
|
95
99
|
uri="amqp://localhost:5672/",
|
|
96
100
|
oauth2_options=your_oauth_options
|
|
97
101
|
)
|
|
@@ -103,7 +107,7 @@ client = QueueClient(
|
|
|
103
107
|
from weenspace_queue import QueueClient
|
|
104
108
|
|
|
105
109
|
client = QueueClient(
|
|
106
|
-
"
|
|
110
|
+
"RABBITMQ",
|
|
107
111
|
uri="amqps://localhost:5671/",
|
|
108
112
|
ssl_context=your_ssl_context
|
|
109
113
|
)
|
|
@@ -111,7 +115,7 @@ client = QueueClient(
|
|
|
111
115
|
|
|
112
116
|
## 📚 Documentation
|
|
113
117
|
|
|
114
|
-
See [examples](
|
|
118
|
+
See the [examples folder](https://github.com/WeenSpace/weenspace-queue/tree/main/examples) for more detailed usage examples.
|
|
115
119
|
|
|
116
120
|
## 🔄 Migration from python-rabbitmq
|
|
117
121
|
|
|
@@ -30,7 +30,7 @@ pip install weenspace-queue
|
|
|
30
30
|
```python
|
|
31
31
|
from weenspace_queue import Message, QueueClient, QueueSpecification
|
|
32
32
|
|
|
33
|
-
client = QueueClient("
|
|
33
|
+
client = QueueClient("RABBITMQ", uri="amqp://guest:guest@localhost:5672/")
|
|
34
34
|
queue = client.declare_queue(QueueSpecification(name="my-queue"))
|
|
35
35
|
client.publish(queue, Message(body=b"Hello WeenSpace!"))
|
|
36
36
|
|
|
@@ -43,6 +43,10 @@ client.consume(queue, handler=on_message, prefetch=10)
|
|
|
43
43
|
|
|
44
44
|
Install AWS support with `pip install "weenspace-queue[aws]"`.
|
|
45
45
|
|
|
46
|
+
### AWS SQS and SNS
|
|
47
|
+
|
|
48
|
+
See [examples/aws/sqs.py](https://github.com/WeenSpace/weenspace-queue/blob/main/examples/aws/sqs.py) for direct SQS publishing and [examples/aws/sns.py](https://github.com/WeenSpace/weenspace-queue/blob/main/examples/aws/sns.py) for an SNS-to-SQS workflow with routing-key filters.
|
|
49
|
+
|
|
46
50
|
### Async Support
|
|
47
51
|
|
|
48
52
|
```python
|
|
@@ -50,7 +54,7 @@ import asyncio
|
|
|
50
54
|
from weenspace_queue import AsyncQueueClient, Message, QueueSpecification
|
|
51
55
|
|
|
52
56
|
async def main():
|
|
53
|
-
async with AsyncQueueClient("
|
|
57
|
+
async with AsyncQueueClient("RABBITMQ", uri="amqp://localhost:5672/") as client:
|
|
54
58
|
queue = await client.declare_queue(QueueSpecification(name="my-queue"))
|
|
55
59
|
await client.publish(queue, Message(body=b"Async message!"))
|
|
56
60
|
|
|
@@ -63,7 +67,7 @@ asyncio.run(main())
|
|
|
63
67
|
from weenspace_queue import QueueClient
|
|
64
68
|
|
|
65
69
|
client = QueueClient(
|
|
66
|
-
"
|
|
70
|
+
"RABBITMQ",
|
|
67
71
|
uri="amqp://localhost:5672/",
|
|
68
72
|
oauth2_options=your_oauth_options
|
|
69
73
|
)
|
|
@@ -75,7 +79,7 @@ client = QueueClient(
|
|
|
75
79
|
from weenspace_queue import QueueClient
|
|
76
80
|
|
|
77
81
|
client = QueueClient(
|
|
78
|
-
"
|
|
82
|
+
"RABBITMQ",
|
|
79
83
|
uri="amqps://localhost:5671/",
|
|
80
84
|
ssl_context=your_ssl_context
|
|
81
85
|
)
|
|
@@ -83,7 +87,7 @@ client = QueueClient(
|
|
|
83
87
|
|
|
84
88
|
## 📚 Documentation
|
|
85
89
|
|
|
86
|
-
See [examples](
|
|
90
|
+
See the [examples folder](https://github.com/WeenSpace/weenspace-queue/tree/main/examples) for more detailed usage examples.
|
|
87
91
|
|
|
88
92
|
## 🔄 Migration from python-rabbitmq
|
|
89
93
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "weenspace-queue"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.4"
|
|
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"
|
|
@@ -59,7 +59,7 @@ class QueueClient:
|
|
|
59
59
|
"""Single client: pass provider name, then use the same publish/consume/topology methods."""
|
|
60
60
|
|
|
61
61
|
def __init__(self, provider: str, **config: Any) -> None:
|
|
62
|
-
prov_key = provider.
|
|
62
|
+
prov_key = provider.strip().upper()
|
|
63
63
|
engine_cls = _engine_class(prov_key)
|
|
64
64
|
self.provider = prov_key
|
|
65
65
|
self.engine: QueueEngine = engine_cls(**config)
|
|
@@ -102,7 +102,7 @@ class AsyncQueueClient:
|
|
|
102
102
|
"""Async twin of QueueClient. Same method names, same provider argument."""
|
|
103
103
|
|
|
104
104
|
def __init__(self, provider: str, **config: Any) -> None:
|
|
105
|
-
prov_key = provider.
|
|
105
|
+
prov_key = provider.strip().upper()
|
|
106
106
|
engine_cls = _async_engine_class(prov_key)
|
|
107
107
|
self.provider = prov_key
|
|
108
108
|
self.engine: AsyncQueueEngine = engine_cls(**config)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Compatibility namespace for RabbitMQ's bundled Proton API."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|