def __init__(self,
                 channels: list,
                 name: str=None,
                 redis: StrictRedis=None,
                 host: str='127.0.0.1',
                 port: int=6379,
                 db: int=0,
                 password: str=None):
        """
        :param channels: List of channels this BusListener listens on
        :param name:
        :param redis:
        :param host:
        :param port:
        :param db:
        :param password:
        """
        Thread.__init__(self)

        self._log: Logger = logger(self.__class__.__name__)
        log = self._log

        if redis:
            self._r = redis
        else:
            self._r = StrictRedis(host=host,
                                  port=port,
                                  db=db,
                                  password=password)
            log.info("Initialized a new Bus Writer on redis://{}:{}/{}".format(host, port, db))

        self.setName(name
                     if name
                     else "{}{:.0f}".format(self.__class__.__name__, time()))

        self._channels = channels
        self._current_data = {}
        self._callbacks = {}
        self._global_callbacks = []

        log.info("A new {} has been initialized".format(self.__class__.__name__))
        self._running = False
def __init__ ( self , channels : list , name : str = None , redis : StrictRedis = None , host : str = '127.0.0.1' , port : int = 6379 , db : int = 0 , password : str = None ) : Thread . __init__ ( self ) self . _log : Logger = logger ( self . __class__ . __name__ ) log = self . _log if redis : self . _r = redis else : self . _r = StrictRedis ( host = host , port = port , db = db , password = password ) log . info ( "Initialized a new Bus Writer on redis://{}:{}/{}" . format ( host , port , db ) ) self . setName ( name if name else "{}{:.0f}" . format ( self . __class__ . __name__ , time ( ) ) ) self . _channels = channels self . _current_data = { } self . _callbacks = { } self . _global_callbacks = [ ] log . info ( "A new {} has been initialized" . format ( self . __class__ . __name__ ) ) self . _running = False
:param channels: List of channels this BusListener listens on
        :param name:
        :param redis:
        :param host:
        :param port:
        :param db:
        :param password: