redis_connector/redis_connector.py
def subscribe(self, exec_function):
        """Subscribes to the redis queue.

        :param exec_function:
            function that will be executed when the message arrives with the data extracted as only arg
        :type exec_function: executable

        :rtype: None
        """
        message = self.pub_sub.get_message()
        if message:
            data = message['data']
            if message['type'] == 'message':
                data = json.loads(data.decode('utf8').replace("'", '"'))

                # ping messages will be ignored, redis will simply return with the number of subscribers on
                # that channel
                if data.get('message') == 'ping':
                    pass
                else:
                    # No target means promiscuous mode for that message, no lock will be used
                    target = data.pop('target', None)
                    if target is None:
                        exec_function(data)
                    elif target == self.service_name:
                        if self._acquire_lock(data['message_id']):
                            exec_function(data)
Subscribes to the redis queue.

        :param exec_function:
            function that will be executed when the message arrives with the data extracted as only arg
        :type exec_function: executable

        :rtype: None
        
Subscribes to the redis queue.
Subscribes to the redis queue .
def subscribe(self, exec_function):
        message = self.pub_sub.get_message()
        if message:
            data = message['data']
            if message['type'] == 'message':
                data = json.loads(data.decode('utf8').replace("'", '"'))
                if data.get('message') == 'ping':
                    pass
                else:
                    target = data.pop('target', None)
                    if target is None:
                        exec_function(data)
                    elif target == self.service_name:
                        if self._acquire_lock(data['message_id']):
                            exec_function(data)
def subscribe ( self , exec_function ) : message = self . pub_sub . get_message ( ) if message : data = message [ 'data' ] if message [ 'type' ] == 'message' : data = json . loads ( data . decode ( 'utf8' ) . replace ( "'" , '"' ) ) if data . get ( 'message' ) == 'ping' : pass else : target = data . pop ( 'target' , None ) if target is None : exec_function ( data ) elif target == self . service_name : if self . _acquire_lock ( data [ 'message_id' ] ) : exec_function ( data )
Subscribes to the redis queue.
Subscribes to the redis queue .
"""Subscribes to the redis queue.

        :param exec_function:
            function that will be executed when the message arrives with the data extracted as only arg
        :type exec_function: executable

        :rtype: None
        """ # ping messages will be ignored, redis will simply return with the number of subscribers on # that channel # No target means promiscuous mode for that message, no lock will be used
None
None
self
exec_function
function that will be executed when the message arrives with the data extracted as only arg
function that will be executed when the message arrives with the data extracted as only arg