Python asynchronous client for interacting with LowMQ
Project description
Python client for LowMQ
This is a Python asynchronous client for interacting with LowMQ, a message queuing service. The client allows you to send, retrieve, and delete messages from queues hosted on a LowMQ server.
LowMq Server:
Usage
Here's a quick guide on how to use the LowMQ client:
from lowmq_client import LowMqClient
async def main():
# Initialize the LowMQ client
lowmq_url = "https://your-lowmq-server.com"
auth_key = "your-auth-key"
async with LowMqClient(auth_key, lowmq_url) as client:
# Add a packet to a queue
await client.add_packet("queue_name", {"key": "value"})
# Get a packet from a queue
packet = await client.get_packet("queue_name")
print(packet)
# Delete a packet from a queue
packet_id = packet['_id']
await client.delete_packet("queue_name", packet_id)
API Reference
-
LowMqClient(auth_key: str, lowmq_url: str)
Constructor for the LowMQ client.auth_key:
Authentication key for accessing the LowMQ server.lowmq_url:
URL of the LowMQ server.
-
async set_auth_key(auth_key: str)
Set a new authentication key.auth_key:
New authentication key.
-
async set_lowmq_url(lowmq_url: str)
Set a new LowMQ server URL.lowmq_url:
New LowMQ server URL.
-
async add_packet(queue_name: str, payload: dict, freeze_time_min: int = 5) -> dict
Add a packet to a queue.queue_name:
Name of the queue.payload:
Payload of the packet.freeze_time_min:
Optional. Freeze time for the message in minutes (default is 5).
-
async get_packet(queue_name: str, delete: bool = False) -> dict
Retrieve a packet from a queue.queue_name:
Name of the queue.delete:
Optional. If True, the retrieved packet will be deleted from the queue (default is False).
-
async delete_packet(queue_name: str, packet_id: str) -> bool
Delete a packet from a queue.queue_name:
Name of the queue.packet_id:
ID of the packet to delete.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file lowmq-client-0.0.2.tar.gz
.
File metadata
- Download URL: lowmq-client-0.0.2.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30847d4449a0eb37714d04a0848589a88f8ed75d0293a58154fad43890cf2549 |
|
MD5 | b3fad25ee29b1a9c0bf9810fa507f4cf |
|
BLAKE2b-256 | 4a64b0860e0448352ed482f4cb292295f7a574ae1f6f33e5229c62d3c117d8c4 |