Returns a Monitor object for the specified target node. The default cluster node will be selected if no target node was specified. Monitor is useful for handling the MONITOR command to the redis server. next_command() method returns one command from monitor
(self, target_node=None)
| 1152 | self.retry = retry |
| 1153 | |
| 1154 | def monitor(self, target_node=None): |
| 1155 | """ |
| 1156 | Returns a Monitor object for the specified target node. |
| 1157 | The default cluster node will be selected if no target node was |
| 1158 | specified. |
| 1159 | Monitor is useful for handling the MONITOR command to the redis server. |
| 1160 | next_command() method returns one command from monitor |
| 1161 | listen() method yields commands from monitor. |
| 1162 | """ |
| 1163 | if target_node is None: |
| 1164 | target_node = self.get_default_node() |
| 1165 | if target_node.redis_connection is None: |
| 1166 | raise RedisClusterException( |
| 1167 | f"Cluster Node {target_node.name} has no redis_connection" |
| 1168 | ) |
| 1169 | return target_node.redis_connection.monitor() |
| 1170 | |
| 1171 | def pubsub(self, node=None, host=None, port=None, **kwargs): |
| 1172 | """ |
nothing calls this directly
no test coverage detected