| :mod:`airflow.contrib.sensors.redis_pub_sub_sensor` |
| =================================================== |
| |
| .. py:module:: airflow.contrib.sensors.redis_pub_sub_sensor |
| |
| |
| Module Contents |
| --------------- |
| |
| .. py:class:: RedisPubSubSensor(channels, redis_conn_id, *args, **kwargs) |
| |
| Bases: :class:`airflow.sensors.base_sensor_operator.BaseSensorOperator` |
| |
| Redis sensor for reading a message from pub sub channels |
| |
| .. attribute:: template_fields |
| :annotation: = ['channels'] |
| |
| |
| |
| .. attribute:: ui_color |
| :annotation: = #f0eee4 |
| |
| |
| |
| |
| .. 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 |
| :type context: dict |
| :return: ``True`` if message (with type 'message') is available or ``False`` if not |
| |
| |
| |
| |