PATIO Redis
PATIO is an acronym for Python Asynchronous Task for AsyncIO.
This package provides Redis broker implementation.
Example
Worker
import asyncio
import operator
from functools import reduce
from patio import Registry, ThreadPoolExecutor
from patio_redis import RedisBroker
rpc = Registry(project="test", strict=True)
@rpc("mul")
def mul(*args):
return reduce(operator.mul, args)
async def main():
async with ThreadPoolExecutor(rpc, max_workers=16) as executor:
async with RedisBroker(
executor, url="redis://127.0.0.1:6379", max_connections=50,
) as broker:
await broker.join()
if __name__ == "__main__":
asyncio.run(main())
Producer
import asyncio
from patio import NullExecutor, Registry
from patio_redis import RedisBroker
rpc = Registry(project="test", strict=True)
async def main():
async with NullExecutor(rpc) as executor:
async with RedisBroker(
executor, url="redis://127.0.0.1/", max_connections=50,
) as broker:
for i in range(50):
print(
await asyncio.gather(
*[
broker.call("mul", i, j, timeout=1)
for j in range(200)
]
),
)
if __name__ == "__main__":
asyncio.run(main())
Metadata
Release files for patio-redis 0.1.1
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 |
|---|---|---|---|---|
| patio_redis-0.1.1.tar.gz | 3.8 kB | Without provenance | Details for patio_redis-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| patio_redis-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for patio_redis-0.1.1-py3-none-any.whl |
Total release size: 8.4 kB
Release files / patio_redis-0.1.1.tar.gz
| Download URL | patio_redis-0.1.1.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6658d459bf1f81baa25012b143bedacd26fa0ca85c7a8d1ee97312ae1ad0b85f
|
|
BLAKE2b-256 checksum How to use checksums |
0bcd103b03eca157939f931fffa6e199680afe03ca0c2dacc94c246c26447450
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.0 CPython/3.10.2 Darwin/22.4.0
|
Release files / patio_redis-0.1.1-py3-none-any.whl
| Download URL | patio_redis-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
60fc72f16f5bb10ea4bf92e5737948200e8ec4cf8927270e2ddd98cbee1e5845
|
|
BLAKE2b-256 checksum How to use checksums |
986979be52004b04dcf3f091f0ada24a7ffdb5d7891e92320ff4a9ee1dd81847
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.0 CPython/3.10.2 Darwin/22.4.0
|
Security for patio-redis 0.1.1
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.