🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

redis-ipc

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redis-ipc

A minimal multi producer single consumer IPC using redis pub/sub

0.2.1
Maintainers
1

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_error handler 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.get and IPC.publish
  • added more comments to examples
  • added basic logging

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts