| :py:mod:`airflow.providers.redis.sensors.redis_pub_sub` |
| ======================================================= |
| |
| .. py:module:: airflow.providers.redis.sensors.redis_pub_sub |
| |
| |
| Module Contents |
| --------------- |
| |
| Classes |
| ~~~~~~~ |
| |
| .. autoapisummary:: |
| |
| airflow.providers.redis.sensors.redis_pub_sub.RedisPubSubSensor |
| |
| |
| |
| |
| .. py:class:: RedisPubSubSensor(*, channels, redis_conn_id, **kwargs) |
| |
| Bases: :py:obj:`airflow.sensors.base.BaseSensorOperator` |
| |
| Redis sensor for reading a message from pub sub channels |
| |
| :param channels: The channels to be subscribed to (templated) |
| :param redis_conn_id: the redis connection id |
| |
| .. py:attribute:: template_fields |
| :annotation: :Sequence[str] = ['channels'] |
| |
| |
| |
| .. py:attribute:: ui_color |
| :annotation: = #f0eee4 |
| |
| |
| |
| .. py:method:: poke(self, context) |
| |
| Check for message on subscribed channels and write to xcom the message with key ``message`` |
| |
| An example of message ``{'type': 'message', 'pattern': None, 'channel': b'test', 'data': b'hello'}`` |
| |
| :param context: the context object |
| :return: ``True`` if message (with type 'message') is available or ``False`` if not |
| |
| |
| |