Python client for HTTP message queue Queued: https://github.com/scttnlsn/queued.
Usage
>>> import pyqueued
Get a client.
>>> client = pyqueued.Client(host='localhost', port=5353)
Enqueue a message:
>>> loc = client.enqueue("q", "my message")
>>> loc
'http://localhost:5353/q/155'
Get the head of the queue. Without any timeout, the item is marked as completed when dequeued.
>>> msg, loc = client.dequeue("q")
>>> msg
'my message'
THe queue is empty now, so another dequeue will fail:
>>> msg, loc = client.dequeue("q")
...
RuntimeError: dequeue failed: <Response [404]>
Enqueue another message:
>>> loc = client.enqueue("q", "another message")
But dequeue with timeout (given in seconds). If the message is not completed within timeout, it will be enqueued again.
>>> client.dequeue("q", timeout=2)
('another message', 'http://localhost:5353/q/160')
The has message timed out and has been enqueued again. So we can actually dequeue it once more. But now we mark it completed in time.
>>> client.dequeue("q", timeout=20) ('my message with timeout', 'http://localhost:5353/q/160')>>> client.complete("q", "160")
Alternatively, item can be completed by URL. To the last line have been written also as:
>>> client.complete_by_url('http://localhost:5353/q/160')
Stats about the queue:
>>> client.stats("q")
{'depth': 1, 'dequeued': 3, 'enqueued': 3, 'timeouts': 1}
Metadata
Release files for pyqueued 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyqueued-0.1.4.tar.gz | 2.2 kB | Without provenance | Details for pyqueued-0.1.4.tar.gz |
Release files / pyqueued-0.1.4.tar.gz
| Download URL | pyqueued-0.1.4.tar.gz |
|---|---|
| Size | 2.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f7738500624d331ff16880ce87a1a93878acef40beed86b2f8ec4e01101c4180
|
|
BLAKE2b-256 checksum How to use checksums |
1829544c04609f4572eca347c43b4139b532ca06c94c37167a76d8794bfca341
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pyqueued 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.