class platypush.backend.redis.RedisBackend(*args, queue='platypush_bus_mq', redis_args=None, **kwargs)[source]#

Bases: Backend

Backend that reads messages from a configured Redis queue (default: platypush_bus_mq) and posts them to the application bus. Very useful when you have plugin whose code is executed in another process and can’t post events or requests to the application bus.

__init__(*args, queue='platypush_bus_mq', redis_args=None, **kwargs)[source]#

Starts the backend thread. To be implemented in the derived classes if the loop method isn’t defined.

send_message(msg: str | Message, queue_name: str | None = None, **_)[source]#

Send a message to a Redis queue.

  • msg – Message to send, as a Message object or a string.

  • queue_name – Queue name to send the message to (default: platypush_bus_mq).