Earlgrey
Earlgrey is a python library which provides a convenient way to publish and consume messages between processes using RabbitMQ. It is abstracted to RPC pattern.
How to use
# RPC methods
class Task:
@message_queue_task
async def echo(self, value):
return value
# Client stub
class Stub(MessageQueueStub[Task]):
TaskType = Task
# Server service
class Service(MessageQueueService[Task]):
TaskType = Task
async def run():
route_key = 'any same string between processes'
client = Stub('localhost', route_key)
server = Service('localhost', route_key)
await client.connect()
await server.connect()
result = await client.async_task().echo('any value')
print(result) # 'any value'
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
Caution
Actually MessageQueueStub does not need exact Task class which has full implementation of methods. It just needs signature of methods.
# client side.
class Task:
@message_queue_task
async def echo(self, value):
# Just signature. It is okay. Do not need implemetation.
# But server must have its implementation
pass
Metadata
Release files for earlgrey 0.2.2
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 | |
|---|---|---|---|---|
| earlgrey-0.2.2.tar.gz | 10.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| earlgrey-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.7 kB
Release files / earlgrey-0.2.2.tar.gz
| Download URL | earlgrey-0.2.2.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e53f1c02281838990f472a4cd84c88ec2476aa1fbe0c1fd02da609d8f2c286e
|
|
BLAKE2b-256 checksum How to use checksums |
aa3fc9daac728ac906d80af746529bf4e9b1c555a492394bb1a5d73618ddbf5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.7.6
|
Release files / earlgrey-0.2.2-py3-none-any.whl
| Download URL | earlgrey-0.2.2-py3-none-any.whl |
|---|---|
| Size | 25.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0982e362820c04820d3af2fdff3b09c487e6ac4b11d788f15293d7b8e30f04a5
|
|
BLAKE2b-256 checksum How to use checksums |
bc981d0168fd35727892fe55e63300ff57fcf289707658c3453a3f3bd4c3bed7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.7.6
|
Security for earlgrey 0.2.2
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.