Redis IPC
A lightweight multiple producer and single consumer IPC server that uses redis pubsub as a broker
Creates a redis ipc server that listens on a single pub/sub channel and allows you to communicate between multiple processes
Subclass the IPC class and add your handlers as methods
like this (handlers must start with handle_ as their name)
async def handle_channel_update(self, data):
return data
or use IPC.add_handler to add the handler after the
class has been instantiated
and whenever a process calls IPC.get, all the clients connected to
that channel will try to handle the request and whichever one finishes
first, will be returned by the function
the handler must either return a dict or None
None is treated as an implicit reason that the current
process doesn't matches the requests' target process
Changelog
Version 0.2.1
Bug Fixes
- Fixes a race condition where Future.set_result would raise InvalidStateError if another producer set a result already
Added
- Changelog to pypi long description
Version 0.2.0
Added
- Adds
IPC.on_errorhandler for when a handler errors out. Takes error as first argument and message (the request data) as second
Version 0.1.0
Added
- required_identity kwarg on
IPC.getandIPC.publish - added more comments to examples
- added basic logging
Metadata
Release files for redis-ipc 0.2.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 | |
|---|---|---|---|
| redis-ipc-0.2.1.tar.gz | 17.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| redis_ipc-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.6 kB
Release files / redis-ipc-0.2.1.tar.gz
| Download URL | redis-ipc-0.2.1.tar.gz |
|---|---|
| Size | 17.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b66def37b018ecde49b443a21ae0acc90865ae0e45b1dcfa29b401b7dbcc273c
|
|
BLAKE2b-256 checksum How to use checksums |
1e9b0a5acaf59160ed4efab106b92fec7ace64ed215085abe3f0ec734debc4e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|
Release files / redis_ipc-0.2.1-py3-none-any.whl
| Download URL | redis_ipc-0.2.1-py3-none-any.whl |
|---|---|
| Size | 17.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e57a3c010b672da054db0ee5f5bda10adffee708fdac7fa67d60047eb5853ce4
|
|
BLAKE2b-256 checksum How to use checksums |
a7684e442b95118914d6c1cb97529146ecc6168a24fc4e68c88315f9c33fd134
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|