You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+105-1Lines changed: 105 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Suhaib Message Queue (SMQ) is an ultra-lightweight, efficient messaging queue sy
8
8
-**Flexible Deployment Options**: Run as a Docker container, integrate within Go applications, or operate as a standalone executable.
9
9
-**Reliable Persistence**: Uses SQLite to store messages on disk with a write-ahead log and rollback journal, ensuring data durability across restarts and failures.
10
10
-**gRPC Integration**: Utilizes gRPC for efficient, scalable communication between distributed services.
11
-
-**Client Package**: Includes a client package to facilitate easy integration and communication.
11
+
-**Client Packages**: Includes both a Go client package and a Python client package (pysmq on PyPI) to facilitate easy integration and communication across different languages.
12
12
13
13
## Why Choose SMQ Over Apache Kafka or RabbitMQ?
14
14
SMQ is particularly advantageous in environments where simplicity, minimal overhead, and integration ease are paramount over the comprehensive feature sets of larger systems like Apache Kafka or RabbitMQ. It is especially well-suited for:
@@ -194,3 +194,107 @@ func main() {
194
194
log.Printf("Received message at offset %d: %s", offset, string(msg))
195
195
}
196
196
```
197
+
198
+
## Python Client Usage
199
+
200
+
SMQ also provides a Python client package (`pysmq`) available on PyPI, which allows Python applications to interact with SMQ servers.
201
+
202
+
### Installing the Python Client
203
+
204
+
Install the Python client using pip:
205
+
206
+
```bash
207
+
pip install pysmq
208
+
```
209
+
210
+
### Basic Usage Examples
211
+
212
+
#### Publishing Messages
213
+
214
+
Here's an example of how to publish messages to an SMQ server using the Python client:
215
+
216
+
```python
217
+
import json
218
+
import time
219
+
from pysmq.client import Client
220
+
221
+
# Create a client
222
+
with Client(host="localhost", port=8097) as client:
0 commit comments